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 System.Collections.ObjectModel;
using System.Windows.Threading;
using Telerik.Windows.Controls.Charting;
using System.Data;

namespace WpfApplication6
{
	/// <summary>
	/// Interaction logic for Window1.xaml
	/// </summary>
	public partial class Window1 : Window
	{
		protected override void OnInitialized(EventArgs e)
		{
			base.OnInitialized(e);

			FillSampleChartData();
		}

		private void FillSampleChartData()
		{
			for (int seriesIndex = 0; seriesIndex < 2; seriesIndex++)
			{
				DataSeries lineSeries = new DataSeries();
				lineSeries.Definition = new LineSeriesDefinition();

				Random random = new Random((int)(lineSeries.GetHashCode() + DateTime.Now.Ticks));
				for (int itemIndex = 0; itemIndex < 10; itemIndex++)
				{
					int randomNumber = random.Next(30, 100);
					lineSeries.Add(new DataPoint { XValue = randomNumber, YValue = randomNumber });
				}

				this.RadChart1.DefaultView.ChartArea.DataSeries.Add(lineSeries);
			}
		} 
	}

}

