0

How to draw AreaSeries with all of points in lineseries with Y > 50

Tin Truong 3 aastat tagasi 0

I want to draw AreaSeries with all of points in Lineseries with Y > 50. But I got the result like image below.
I just want to draw AreaSeries in red rectangle area. 

Image 172

var areaSeries = new AreaSeries()
{
StrokeThickness = 2,
LineStyle = OxyPlot.LineStyle.Solid,
Color = OxyColors.Transparent,
Color2 = OxyColors.Transparent,
Fill = OxyColors.Green,
DataFieldX2 = "X",
ConstantY2 = 50,

};

// Fill series with initial values
foreach (var point in seriesLumen.Points)
{
if (point.Y >= 50)
{
areaSeries.Points.Add(point);
}
}

tmp.Series.Add(areaSeries);