-
Notifications
You must be signed in to change notification settings - Fork 200
/
Copy pathSplineRangeArea.cs
83 lines (71 loc) · 2.65 KB
/
SplineRangeArea.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#region Copyright Syncfusion® Inc. 2001-2025.
// Copyright Syncfusion® Inc. 2001-2025. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// [email protected]. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using Syncfusion.SfChart.iOS;
using Foundation;
namespace SampleBrowser
{
public class SplineRangeArea : SampleView
{
public SplineRangeArea()
{
SFChart chart = new SFChart();
chart.ColorModel.Palette = SFChartColorPalette.Natural;
chart.Title.Text = new NSString("Product Price Comparison");
SFCategoryAxis primary = new SFCategoryAxis();
primary.EdgeLabelsDrawingMode = SFChartAxisEdgeLabelsDrawingMode.Shift;
primary.ShowMajorGridLines = false;
chart.PrimaryAxis = primary;
chart.SecondaryAxis = new SFNumericalAxis();
chart.SecondaryAxis.ShowMajorGridLines = false;
chart.SecondaryAxis.ShowMinorGridLines = false;
chart.SecondaryAxis.Minimum = new NSNumber(5);
chart.SecondaryAxis.Maximum = new NSNumber(55);
chart.SecondaryAxis.Interval = new NSNumber(5);
NSNumberFormatter secondaryAxisFormatter = new NSNumberFormatter();
secondaryAxisFormatter.PositivePrefix = "$";
chart.SecondaryAxis.LabelStyle.LabelFormatter = secondaryAxisFormatter;
ChartViewModel dataModel = new ChartViewModel();
SFSplineRangeAreaSeries series1 = new SFSplineRangeAreaSeries();
series1.ItemsSource = dataModel.RangeAreaData;
series1.XBindingPath = "XValue";
series1.High = "High";
series1.Low = "Low";
series1.EnableTooltip = true;
series1.Label = "Product A";
series1.EnableAnimation = true;
chart.Series.Add(series1);
SFSplineRangeAreaSeries series2 = new SFSplineRangeAreaSeries();
series2.ItemsSource = dataModel.RangeAreaData1;
series2.XBindingPath = "XValue";
series2.High = "High";
series2.Low = "Low";
series2.EnableTooltip = true;
series2.Label = "Product B";
chart.Legend.IconHeight = 14;
series2.EnableAnimation = true;
chart.Series.Add(series2);
chart.Legend.Visible = true;
chart.Legend.IconWidth = 14;
chart.Legend.IconHeight = 14;
chart.ColorModel.Palette = SFChartColorPalette.Natural;
chart.Legend.ToggleSeriesVisibility = true;
chart.Legend.DockPosition = SFChartLegendPosition.Bottom;
chart.PrimaryAxis.EdgeLabelsDrawingMode = SFChartAxisEdgeLabelsDrawingMode.Shift;
this.AddSubview(chart);
}
public override void LayoutSubviews()
{
foreach (var view in this.Subviews)
{
view.Frame = Bounds;
}
base.LayoutSubviews();
}
}
}