简体   繁体   English

同一 LineSeries 的多色标记 - OxyPlot

[英]Multi color Marker for same LineSeries - OxyPlot

Is it possible to have a different marker style for ranges among (XY-Axis) values ?对于(XY 轴)值之间的范围,是否可以使用不同的标记样式? For example.例如。 The marker style is shown in steel blue color here, Can I have markers above 15 and below 13 to show another color ?标记样式在此处以钢蓝色显示,我可以使用 15 以上和 13 以下的标记来显示另一种颜色吗?

Display:展示:

在此处输入图片说明

Oxyplot has both a TwoColorLineSeries and a ThreeColorLineSeries Oxyplot 有一个TwoColorLineSeries和一个ThreeColorLineSeries

Here is an example with the 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; }
}

带有随机数据的 ThreeColorLineSeries 示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM