同一LineSeries的多色标记-OxyPlot
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了同一LineSeries的多色标记-OxyPlot相关的知识,希望对你有一定的参考价值。
答案
Oxyplot同时具有TwoColorLineSeries
和ThreeColorLineSeries
这里是ThreeColorLineSeries
的例子
public class MainViewModel
{
public MainViewModel()
{
Model = new PlotModel
{
Title = "Colouring example"
};
var series = new ThreeColorLineSeries();
// Random data
var rand = new Random(Guid.NewGuid().GetHashCode());
var x = 0;
while (x < 50)
{
series.Points.Add(new DataPoint(x, rand.Next(0, 20)));
x+=1;
}
// Colour limits
series.LimitHi = 14;
series.LimitLo = 7;
// Colours
series.Color = OxyColor.FromRgb(255,0,0);
series.ColorHi = OxyColor.FromRgb(0,255,0);
series.ColorLo = OxyColor.FromRgb(0,0,255);
Model.Series.Add(series);
}
public PlotModel Model { get; set; }
}
以上是关于同一LineSeries的多色标记-OxyPlot的主要内容,如果未能解决你的问题,请参考以下文章
如何在 OxyPlot 图表上绘制 MULTIPLE LineSeries?