forked from syncfusion/xamarin-demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRangeColumn.cs
81 lines (73 loc) · 3.13 KB
/
RangeColumn.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
#region Copyright Syncfusion Inc. 2001-2021.
// Copyright Syncfusion Inc. 2001-2021. 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
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Com.Syncfusion.Charts;
using Android.Graphics;
using Com.Syncfusion.Charts.Enums;
namespace SampleBrowser
{
internal class RangeColumn : SamplePage
{
SfChart chart;
public override View GetSampleContent(Context context)
{
chart = new SfChart(context);
chart.Title.Text = "Temperature Variation";
chart.Title.TextSize = 15;
chart.SetBackgroundColor(Color.White);
chart.Legend.Visibility = Visibility.Visible;
chart.Legend.DockPosition = ChartDock.Bottom;
chart.Legend.IconHeight = 14;
chart.Legend.IconWidth = 14;
chart.Legend.ToggleSeriesVisibility = true;
chart.ColorModel.ColorPalette = ChartColorPalette.Natural;
CategoryAxis categoryaxis = new CategoryAxis();
categoryaxis.ShowMajorGridLines = false;
categoryaxis.LabelPlacement = LabelPlacement.BetweenTicks;
chart.PrimaryAxis = categoryaxis;
NumericalAxis numericalaxis = new NumericalAxis();
numericalaxis.Interval = 5;
numericalaxis.LineStyle.StrokeWidth = 0;
numericalaxis.MajorTickStyle.TickSize = 0;
numericalaxis.LabelStyle.LabelFormat = "##.##" + (char)0x00B0 + "C";
chart.SecondaryAxis = numericalaxis;
RangeColumnSeries rangeColumnSeries = new RangeColumnSeries();
rangeColumnSeries.EnableAnimation = true;
rangeColumnSeries.ItemsSource = MainPage.GetRangeColumnData1();
rangeColumnSeries.XBindingPath = "XValue";
rangeColumnSeries.High = "High";
rangeColumnSeries.Low = "Low";
rangeColumnSeries.Label = "India";
rangeColumnSeries.LegendIcon = ChartLegendIcon.SeriesType;
RangeColumnSeries rangeColumnSeries1 = new RangeColumnSeries();
rangeColumnSeries1.EnableAnimation = true;
rangeColumnSeries1.ItemsSource = MainPage.GetRangeColumnData2();
rangeColumnSeries1.XBindingPath = "XValue";
rangeColumnSeries1.High = "High";
rangeColumnSeries1.Low = "Low";
rangeColumnSeries1.Label = "Germany";
rangeColumnSeries1.LegendIcon = ChartLegendIcon.SeriesType;
chart.Series.Add(rangeColumnSeries);
chart.Series.Add(rangeColumnSeries1);
rangeColumnSeries.TooltipEnabled = true;
rangeColumnSeries1.TooltipEnabled = true;
rangeColumnSeries.EnableAnimation = true;
rangeColumnSeries1.EnableAnimation = true;
return chart;
}
}
}