相同 LineSeries 的多色标记 - OxyPlot
Multi color Marker for same LineSeries - OxyPlot
是否可以为(XY 轴)值之间的范围设置不同的标记样式?例如。标记样式在这里显示为钢蓝色,我可以让标记在 15 以上和以下 13 显示另一种颜色吗?
显示:
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();
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; }
}
是否可以为(XY 轴)值之间的范围设置不同的标记样式?例如。标记样式在这里显示为钢蓝色,我可以让标记在 15 以上和以下 13 显示另一种颜色吗?
显示:
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();
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; }
}