using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;

namespace RadChartingKitDemos
{
    public partial class MainPage : UserControl
    {
        public ObservableCollection<ObservableCollection<SampleChartDataItem>> chartData { get; set; }

        public MainPage()
        {
            InitializeComponent();

            this.DataContext = this;

            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }

        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            Random rnd = new Random();

            chartData = new ObservableCollection<ObservableCollection<SampleChartDataItem>>();

            for (int y = 0; y < 5; y++)
            {
                var tempCollection = new ObservableCollection<SampleChartDataItem>();

                for (int i = 0; i < 20; i++)
                {
                    tempCollection.Add(new SampleChartDataItem()
                    {
                        id = i,
                        value1 = rnd.NextDouble() * 20,
                        value2 = rnd.NextDouble() * 40 * (i % 2 == 0 ? 1 : -1),
                        angle = i * 18,
                        dtvalue = DateTime.Today.AddDays(i)
                    });
                }

                chartData.Add(tempCollection);
            }
        }
    }

    public class SampleChartDataItem
    {
        public int id { get; set; }
        public double value1 { get; set; }
        public double value2 { get; set; }
        public double angle { get; set; }
        public DateTime dtvalue { get; set; }

        public SampleChartDataItem()
        {

        }
    }
}
