-
Notifications
You must be signed in to change notification settings - Fork 204
/
OHLC.cs
48 lines (44 loc) · 1.44 KB
/
OHLC.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
using Android.App;
using Android.Content;
using Android.Graphics;
using Android.OS;
using Android.Views;
using Com.Syncfusion.Charts;
namespace SampleBrowser
{
public class OHLC : SamplePage
{
public override View GetSampleContent(Context context)
{
var chart = new SfChart(context);
chart.SetBackgroundColor(Color.White);
chart.Title.Text = "Financial Analysis";
chart.Title.TextSize = 15;
DateTimeAxis dateTimeAxis = new DateTimeAxis();
dateTimeAxis.LabelStyle.LabelFormat = "MM/dd/yyyy";
dateTimeAxis.LabelRotationAngle = -45;
dateTimeAxis.Title.Text = "Date";
chart.PrimaryAxis = dateTimeAxis;
NumericalAxis numericalAxis = new NumericalAxis();
numericalAxis.Title.Text = "Price in Dollar";
numericalAxis.Minimum = 0;
numericalAxis.Maximum = 250;
numericalAxis.Interval = 50;
numericalAxis.LabelStyle.LabelFormat = "$##.##";
chart.SecondaryAxis = numericalAxis;
chart.Series.Add(new HiLoOpenCloseSeries
{
StrokeWidth = 5,
ItemsSource = MainPage.GetOhlcData(),
XBindingPath = "XValue",
Open = "Open",
Close = "Close",
High = "High",
Low = "Low",
TooltipEnabled = true,
EnableAnimation = true,
});
return chart;
}
}
}