public static PlotModel TwoColorAreaSeries2() { var model = new PlotModel { Title = "TwoColorAreaSeries", LegendSymbolLength = 24 }; var s1 = new TwoColorAreaSeries { Title = "Temperature at Eidesmoen, December 1986.", TrackerFormatString = "December {2:0}: {4:0.0} °C", Color = OxyColors.Black, Color2 = OxyColors.Brown, MarkerFill = OxyColors.Red, Fill = OxyColors.Tomato, Fill2 = OxyColors.LightBlue, MarkerFill2 = OxyColors.Blue, MarkerStroke = OxyColors.Brown, MarkerStroke2 = OxyColors.Black, StrokeThickness = 2, Limit = 0, Smooth = false, MarkerType = MarkerType.Circle, MarkerSize = 3, }; var temperatures = new[] { 5, 0, 7, 7, 4, 3, 5, 5, 11, 4, 2, 3, 2, 1, 0, 2, -1, 0, 0, -3, -6, -13, -10, -10, 0, -4, -5, -4, 3, 0, -5 }; for (int i = 0; i < temperatures.Length; i++) { s1.Points.Add(new DataPoint(i + 1, temperatures[i])); } model.Series.Add(s1); model.Axes.Add(new LinearAxis { Position = AxisPosition.Left, Title = "Temperature", Unit = "°C", ExtraGridlines = new[] { 0.0 } }); model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, Title = "Date" }); return model; }
public static PlotModel TwoColorAreaSeriesTwoPolygons() { var model = new PlotModel { Title = "Two polygons", LegendSymbolLength = 24 }; var s1 = new TwoColorAreaSeries { Color = OxyColors.Tomato, Color2 = OxyColors.LightBlue, MarkerFill = OxyColors.Tomato, MarkerFill2 = OxyColors.LightBlue, StrokeThickness = 2, MarkerType = MarkerType.Circle, MarkerSize = 3, }; s1.Points.AddRange(new []{new DataPoint(0, 3), new DataPoint(1, 5), new DataPoint(2, 1), new DataPoint(3, 0), new DataPoint(4, 3) }); s1.Points2.AddRange(new[] { new DataPoint(0, -3), new DataPoint(1, -1), new DataPoint(2, 0), new DataPoint(3, -6), new DataPoint(4, -4) }); model.Series.Add(s1); model.Axes.Add(new LinearAxis { Position = AxisPosition.Left }); model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom}); return model; }