-
Notifications
You must be signed in to change notification settings - Fork 204
/
Spline.cs
97 lines (88 loc) · 4.15 KB
/
Spline.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using Android.App;
using Android.Content;
using Android.Graphics;
using Android.OS;
using Android.Views;
using Com.Syncfusion.Charts;
using Com.Syncfusion.Charts.Enums;
namespace SampleBrowser
{
public class Spline : SamplePage
{
public override View GetSampleContent(Context context)
{
var chart = new SfChart(context);
chart.SetBackgroundColor(Color.White);
chart.Title.Text = "NC Weather Report";
chart.Title.TextSize = 15;
chart.SetBackgroundColor(Color.White);
chart.Legend.DockPosition = ChartDock.Bottom;
chart.Legend.IconHeight = 14;
chart.Legend.IconWidth = 14;
chart.Legend.Visibility = Visibility.Visible;
chart.Legend.ToggleSeriesVisibility = true;
chart.ColorModel.ColorPalette = ChartColorPalette.Natural;
CategoryAxis categoryaxis = new CategoryAxis();
categoryaxis.LabelPlacement = LabelPlacement.BetweenTicks;
categoryaxis.EdgeLabelsDrawingMode = EdgeLabelsDrawingMode.Shift;
chart.PrimaryAxis = categoryaxis;
NumericalAxis numericalaxis = new NumericalAxis();
numericalaxis.Minimum = 0;
numericalaxis.Maximum = 40;
numericalaxis.Interval = 10;
numericalaxis.LineStyle.StrokeWidth = 0;
numericalaxis.MajorTickStyle.TickSize = 0;
numericalaxis.LabelStyle.LabelFormat = "##.##" + (char)0x00B0 + "C";
chart.SecondaryAxis = numericalaxis;
SplineSeries splineSeries1 = new SplineSeries();
splineSeries1.ItemsSource = MainPage.GetSplineData1();
splineSeries1.XBindingPath = "XValue";
splineSeries1.YBindingPath = "YValue";
splineSeries1.Label = "Max Temp";
splineSeries1.DataMarker.ShowMarker = true;
splineSeries1.DataMarker.MarkerWidth = 10;
splineSeries1.DataMarker.MarkerHeight = 10;
splineSeries1.DataMarker.MarkerColor = Color.White;
splineSeries1.DataMarker.MarkerStrokeColor = Color.ParseColor("#00bdae");
splineSeries1.DataMarker.MarkerStrokeWidth = 2;
splineSeries1.LegendIcon = ChartLegendIcon.SeriesType;
splineSeries1.TooltipEnabled = true;
splineSeries1.StrokeWidth = 3;
SplineSeries splineSeries2 = new SplineSeries();
splineSeries2.ItemsSource = MainPage.GetSplineData2();
splineSeries2.XBindingPath = "XValue";
splineSeries2.YBindingPath = "YValue";
splineSeries2.Label = "Avg Temp";
splineSeries2.DataMarker.ShowMarker = true;
splineSeries2.DataMarker.MarkerWidth = 10;
splineSeries2.DataMarker.MarkerHeight = 10;
splineSeries2.DataMarker.MarkerColor = Color.White;
splineSeries2.DataMarker.MarkerStrokeColor = Color.ParseColor("#404041");
splineSeries2.DataMarker.MarkerStrokeWidth = 2;
splineSeries2.LegendIcon = ChartLegendIcon.SeriesType;
splineSeries2.TooltipEnabled = true;
splineSeries2.StrokeWidth = 3;
SplineSeries splineSeries3 = new SplineSeries();
splineSeries3.ItemsSource = MainPage.GetSplineData3();
splineSeries3.XBindingPath = "XValue";
splineSeries3.YBindingPath = "YValue";
splineSeries3.Label = "Min Temp";
splineSeries3.DataMarker.ShowMarker = true;
splineSeries3.DataMarker.MarkerWidth = 10;
splineSeries3.DataMarker.MarkerHeight = 10;
splineSeries3.DataMarker.MarkerColor = Color.White;
splineSeries3.DataMarker.MarkerStrokeColor = Color.ParseColor("#357CD2");
splineSeries3.DataMarker.MarkerStrokeWidth = 2;
splineSeries3.LegendIcon = ChartLegendIcon.SeriesType;
splineSeries3.TooltipEnabled = true;
splineSeries3.StrokeWidth = 3;
splineSeries1.EnableAnimation = true;
splineSeries2.EnableAnimation = true;
splineSeries3.EnableAnimation = true;
chart.Series.Add(splineSeries1);
chart.Series.Add(splineSeries2);
chart.Series.Add(splineSeries3);
return chart;
}
}
}