-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathStackingColumn.cs
92 lines (80 loc) · 4.02 KB
/
StackingColumn.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
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
{
[Activity(Label = "Stacked Columns")]
public class StackingColumn : SamplePage
{
public override View GetSampleContent(Context context)
{
var chart = new SfChart(context);
chart.Title.Text = "Mobile Game Market by Country";
chart.SetBackgroundColor(Color.White);
chart.Legend.Visibility = Visibility.Visible;
chart.Legend.ToggleSeriesVisibility = true;
chart.Legend.DockPosition = ChartDock.Bottom;
chart.Legend.IconHeight = 14;
chart.Legend.IconWidth = 14;
chart.ColorModel.ColorPalette = ChartColorPalette.Natural;
CategoryAxis PrimaryAxis = new CategoryAxis();
PrimaryAxis.ShowMajorGridLines = false;
PrimaryAxis.LabelPlacement = LabelPlacement.BetweenTicks;
chart.PrimaryAxis = PrimaryAxis;
NumericalAxis numericalAxis = new NumericalAxis();
numericalAxis.Title.Text = "Sales";
numericalAxis.Minimum = 0;
numericalAxis.Maximum = 500;
numericalAxis.Interval = 100;
numericalAxis.LineStyle.StrokeWidth = 0;
numericalAxis.MajorTickStyle.TickSize = 0;
numericalAxis.LabelStyle.LabelFormat = "#'B'";
chart.SecondaryAxis = numericalAxis;
StackingColumnSeries stackingColumnSeries = new StackingColumnSeries();
stackingColumnSeries.EnableAnimation = true;
stackingColumnSeries.Label = "UK";
stackingColumnSeries.ItemsSource = MainPage.GetStackedColumnData1();
stackingColumnSeries.XBindingPath = "XValue";
stackingColumnSeries.YBindingPath = "YValue";
stackingColumnSeries.LegendIcon = ChartLegendIcon.SeriesType;
StackingColumnSeries stackingColumnSeries1 = new StackingColumnSeries();
stackingColumnSeries1.EnableAnimation = true;
stackingColumnSeries1.Label = "Germany";
stackingColumnSeries1.ItemsSource = MainPage.GetStackedColumnData2();
stackingColumnSeries1.XBindingPath = "XValue";
stackingColumnSeries1.YBindingPath = "YValue";
stackingColumnSeries1.LegendIcon = ChartLegendIcon.SeriesType;
StackingColumnSeries stackingColumnSeries2 = new StackingColumnSeries();
stackingColumnSeries2.EnableAnimation = true;
stackingColumnSeries2.Label = "France";
stackingColumnSeries2.ItemsSource = MainPage.GetStackedColumnData3();
stackingColumnSeries2.XBindingPath = "XValue";
stackingColumnSeries2.YBindingPath = "YValue";
stackingColumnSeries2.LegendIcon = ChartLegendIcon.SeriesType;
StackingColumnSeries stackingColumnSeries3 = new StackingColumnSeries();
stackingColumnSeries3.EnableAnimation = true;
stackingColumnSeries3.Label = "Italy";
stackingColumnSeries3.ItemsSource = MainPage.GetStackedColumnData4();
stackingColumnSeries3.XBindingPath = "XValue";
stackingColumnSeries3.YBindingPath = "YValue";
stackingColumnSeries3.LegendIcon = ChartLegendIcon.SeriesType;
chart.Series.Add(stackingColumnSeries);
chart.Series.Add(stackingColumnSeries1);
chart.Series.Add(stackingColumnSeries2);
chart.Series.Add(stackingColumnSeries3);
stackingColumnSeries.TooltipEnabled = true;
stackingColumnSeries1.TooltipEnabled = true;
stackingColumnSeries2.TooltipEnabled = true;
stackingColumnSeries3.TooltipEnabled = true;
stackingColumnSeries.EnableAnimation = true;
stackingColumnSeries1.EnableAnimation = true;
stackingColumnSeries2.EnableAnimation = true;
stackingColumnSeries3.EnableAnimation = true;
return chart;
}
}
}