gpt4 book ai didi

c# - 有直径的圆

转载 作者:太空宇宙 更新时间:2023-11-03 23:02:58 34 4
gpt4 key购买 nike

到目前为止,我有一个看起来像这样的 OxyPlot:

enter image description here

但我想创建一个中间有孔的圆圈,我可以给圆圈一个直径,这些圆圈应该有多大。

enter image description here

不要让图片激怒你,圆圈应该大小相同

最后应该是这样的。对于圆,孔位于中间并具有一定的直径。

XAML

<oxy:Plot x:Name="oxyPlot" Title="{Binding Title}" Height="279" Canvas.Left="259" Canvas.Top="29" Width="344" Background="#FFD1CFD0">
<oxy:Plot.Axes>
<oxy:LinearAxis Position="Bottom" MinimumPadding="0.1" MaximumPadding="0.1"/>
<oxy:LinearAxis Position="Left" MinimumPadding="0.1" MaximumPadding="0.1"/>
</oxy:Plot.Axes>
<oxy:Plot.Series>
<oxy:LineSeries x:Name="ls" ItemsSource="{Binding Points}" LineStyle="None" MarkerType="Circle" MarkerSize="5" MarkerFill="Black"/>
</oxy:Plot.Series>
</oxy:Plot>

最佳答案

您应该在 LineSeries 上使用这些属性的组合:

MarkerStroke="Red" 
MarkerType="Circle"
MarkerStrokeThickness="3"
MarkerSize="5"
MarkerFill="Transparent"

MarkerSize 决定了半径,MarkerStrokeThickness 决定了外线的粗细。请注意,为了在中间获得一个空圆,MarkerStrokeThickness 应小于 MarkerSizeMarkerFill 决定了内圈的颜色,MarkerStroke 决定了边框的颜色。

可以通过 MarkerType="Custom" 和设置 MarkerOutline 属性来创建更复杂的形状。

在代码中

        ls.MarkerType = MarkerType.Circle;
ls.MarkerFill = System.Windows.Media.Colors.Transparent;
ls.MarkerStroke = System.Windows.Media.Colors.Red;
ls.MarkerSize = 40;
ls.MarkerStrokeThickness = 3;

关于c# - 有直径的圆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42432141/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com