【问题标题】:Oxyplot division color changeOxyplot 分区颜色变化
【发布时间】:2016-01-15 23:15:01
【问题描述】:

有谁知道如何更改氧绘图上分割标记的颜色?我似乎无法在任何地方找到该特定属性。这是我用来生成下图的代码。如您所见,分割标记是黑色的。真想换个颜色。谢谢。

 <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>

【问题讨论】:

    标签: oxyplot


    【解决方案1】:

    您正在寻找的物业是TicklineColor。你必须在两个轴上都这样做:

    效果:

    代码:

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

    【讨论】:

    • 太棒了。什么版本增加了这个功能?因为当我尝试使用它时,我得到了错误。
    • 我目前的oxyplot版本是2014.1.546.0
    【解决方案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
    

    截图:

    【讨论】:

      猜你喜欢
      • 2019-02-01
      • 1970-01-01
      • 2017-04-23
      • 1970-01-01
      • 2013-11-26
      • 2011-04-12
      • 2013-03-30
      • 1970-01-01
      • 2020-02-06
      相关资源
      最近更新 更多