public FinancialChart()
        {
            InitializeComponent();
            Title = AppResources.FinancialChartTitle;
            List <Color> CustomPalette = new List <Color> {
                Color.FromHex("#3F51B5")
            };

            this.flexChart.CustomPalette             = CustomPalette;
            this.flexChart.Palette                   = Palette.Custom;
            this.flexChart.ItemsSource               = ChartSampleFactory.FinancialData();
            this.flexChart.ChartType                 = ChartType.Candlestick;
            this.flexChart.LegendPosition            = ChartPositionType.None;
            this.flexChart.AxisY.MajorGridStyle.Fill = Color.FromRgba(50, 50, 50, 20);
            this.flexChart.AxisX.Format              = "MM/dd/yyyy";
            this.flexChart.AxisY.AxisLine            = false;
            this.pickerChartType.Items.Add(ChartType.Candlestick.ToString());
            this.pickerChartType.Items.Add(ChartType.HighLowOpenClose.ToString());
            this.pickerChartType.SelectedIndex = 0;

            this.flexChart.AnimationMode = C1.Xamarin.Forms.Chart.AnimationMode.Point;
            C1Animation loadAnimation = new C1Animation();

            loadAnimation.Duration       = new TimeSpan(1000 * 10000);
            loadAnimation.Easing         = Xamarin.Forms.Easing.CubicInOut;
            this.flexChart.LoadAnimation = loadAnimation;
        }
示例#2
0
        private void PrepareFinancialChart()
        {
            this.flexChart.BindingX                  = "Date";
            this.flexChart.LegendPosition            = ChartPositionType.None;
            this.flexChart.AxisY.MajorGridStyle.Fill = Color.FromRgba(50, 50, 50, 20);
            this.flexChart.AxisX.Format              = "MM/dd/yyyy";

            ChartSeries series = new ChartSeries();

            series.SeriesName = "Sales";
            series.Binding    = "High,Low,Open,Close";

            flexChart.Series.Clear();
            flexChart.Series.Add(series);

            this.flexChart.ItemsSource = ChartSampleFactory.FinancialData();
        }