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