using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.Charting;

namespace WpfApplication72
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.RadChart1.DefaultView.ChartArea.AxisY.Title = "Primary Y Axis";
            AxisY axisY = new AxisY();
            axisY.AutoRange = false;
            axisY.DefaultLabelFormat = "N";
            axisY.Step = 10000000;
            axisY.MinValue = 0;
            axisY.MaxValue = 100000000;
            axisY.AxisName = "Secondary";
            axisY.Title = "Secondary Y Axis";
            RadChart1.DefaultView.ChartArea.AdditionalYAxes.Add(axisY);

            this.FillSampleChartData();
        }

        private void FillSampleChartData()
        {
            DataSeries barSeries1;
            DataSeries lineSeries;

            barSeries1 = new DataSeries();

            barSeries1.AddRange(new List<DataPoint> { new DataPoint(19000000), new DataPoint(39000000), new DataPoint(29000000), new DataPoint(59000000), new DataPoint(89000000) });
            barSeries1.Definition = new BarSeriesDefinition();
            barSeries1.LegendLabel = "Primary bar";
            this.RadChart1.DefaultView.ChartArea.DataSeries.Add(barSeries1);

            lineSeries = new DataSeries();

            lineSeries.AddRange(new List<DataPoint> { new DataPoint(33000000), new DataPoint(44000000), new DataPoint(55000000), new DataPoint(66000000), new DataPoint(77000000) });
            lineSeries.Definition = new LineSeriesDefinition();
            lineSeries.LegendLabel = "Line";
            lineSeries.Definition.AxisName = "Secondary";
            this.RadChart1.DefaultView.ChartArea.DataSeries.Add(lineSeries);
        }
    }
}
