Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 隐藏曲线系列中的某些点_Wpf_Oxyplot - Fatal编程技术网

Wpf 隐藏曲线系列中的某些点

Wpf 隐藏曲线系列中的某些点,wpf,oxyplot,Wpf,Oxyplot,我需要显示/隐藏oxyplot线系列中的一些数据点。可能吗? 虽然有些标记是不可见的,但线条应该穿过不可见的标记。您可以使用两个系列来实现这一点。第一种方法是在没有标记的情况下绘制完整的点(和线)。第二个系列将绘制可见点(带有标记,但“线样式”设置为“无”)。比如说 DataPoint[] points = new DataPoint[] { new DataPoint(1,12), new DataPoint(2,10),

我需要显示/隐藏oxyplot线系列中的一些数据点。可能吗?
虽然有些标记是不可见的,但线条应该穿过不可见的标记。

您可以使用两个系列来实现这一点。第一种方法是在没有标记的情况下绘制完整的点(和线)。第二个系列将绘制可见点(带有标记,但“线样式”设置为“无”)。比如说

 DataPoint[] points = new DataPoint[]
        {
            new DataPoint(1,12),
            new DataPoint(2,10),
            new DataPoint(3,9),
            new DataPoint(4,13),
            new DataPoint(5,14),
            new DataPoint(6,10)
        };
        var seriesComplete = new OxyPlot.Series.LineSeries();

        seriesComplete.Points.AddRange(points);


        var seriesVisible = new OxyPlot.Series.LineSeries();
        seriesVisible.Points.AddRange(points.Where(x => x.Y % 2 == 0));
        seriesVisible.MarkerFill = OxyColors.Blue;
        seriesVisible.MarkerType = MarkerType.Circle;
        seriesVisible.MarkerSize = 10;
        seriesVisible.LineStyle = LineStyle.None;

        this.MyModel.Series.Add(seriesComplete);
        this.MyModel.Series.Add(seriesVisible);
结果以图片的形式附上