forked from syncfusion/xamarin-demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Candle.cs
56 lines (50 loc) · 1.87 KB
/
Candle.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
#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
// [email protected]. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Android.App;
using Android.Content;
using Android.Graphics;
using Android.OS;
using Android.Views;
using Com.Syncfusion.Charts;
namespace SampleBrowser
{
public class Candle : SamplePage
{
SfChart chart;
public override View GetSampleContent(Context context)
{
chart = new SfChart(context);
chart.SetBackgroundColor(Color.White);
chart.Title.Text = "Foreign Exchange Rate Analysis";
chart.Title.TextSize = 15;
DateTimeAxis dateTimeAxis = new DateTimeAxis();
dateTimeAxis.LabelRotationAngle = -45;
dateTimeAxis.LabelStyle.LabelFormat = "MM/dd/yyyy";
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;
CandleSeries candleSeries = new CandleSeries();
candleSeries.ItemsSource = MainPage.GetCandleData();
candleSeries.XBindingPath = "XValue";
candleSeries.Open = "Open";
candleSeries.Close = "Close";
candleSeries.High = "High";
candleSeries.Low = "Low";
candleSeries.TooltipEnabled = true;
candleSeries.EnableAnimation = true;
chart.Series.Add(candleSeries);
return chart;
}
}
}