Oxyplot分割线颜色更改

3

有人知道如何更改oxyplot上分割标记的颜色吗? 我似乎找不到那个特定的属性。 这是我用来生成下面绘图的代码。 如您所见,分割标记为黑色。 真的很想改变它们的颜色。 谢谢。

 <oxy:Plot PlotAreaBorderColor="White"  Background="#242426" TextColor="White" Margin="5" Title="X and Y FPOS" TitleFontSize="12" Grid.Row="0" Grid.ColumnSpan="2">
        <oxy:LineSeries ItemsSource="{Binding XYData}"/>
    </oxy:Plot>

enter image description here

2个回答

6
您要查找的属性是 TicklineColor。您需要在两个轴上都设置:

效果:

已获得效果

代码:

<oxy:Plot>
...
    <oxy:Plot.Axes>
        <oxy:LinearAxis Position="Left" TicklineColor="White" />
        <oxy:LinearAxis Position="Bottom" TicklineColor="White" />    
    <oxy:Plot.Axes>
</oxy:Plot>

太棒了。这个功能是在哪个版本中添加的?因为当我尝试使用它时,出现了错误。 - FoggyFinder
我的当前 oxyplot 版本是 2014.1.546.0。 - Jose

2

我认为,目前无法设置标记的颜色。但是,也许您可以尝试使用PlotAreaBackground选项。

示例:

.xaml:

<oxy:Plot PlotAreaBorderColor="Green"  Background="DarkGreen" 
          PlotAreaBackground="#242426" TextColor="White" 
          Title="X and Y FPOS" TitleFontSize="12" 
          Grid.Row="0" Grid.ColumnSpan="2">
    <oxy:LineSeries ItemsSource="{Binding XYData}" Color="Yellow"/>
</oxy:Plot>

.fs:

type MainViewModel() = 
    inherit ViewModelBase()  

    let data = [0.0..0.1..50.0] |> List.mapi(fun i x -> DataPoint(float i, cos x))
    member self.XYData with get() = data

屏幕截图:

PlotAreaBackground


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接