using System;
using System.Collections.Generic;
using System.Windows.Controls;
using Telerik.Windows.Controls.Charting;
using Telerik.Windows.Controls;

namespace SilverlightApplication1
{
    public partial class MainPage : UserControl
    {
        private Random rand = new Random(123456);

        public MainPage()
        {
            InitializeComponent();

            List<ChartData> data = new List<ChartData>();
            for (int i = 0; i < 50; i++)
            {
                data.Add(new ChartData() { Y = rand.Next(1, 10) });
            }

            SeriesMapping sm = new SeriesMapping();
            sm.SeriesDefinition = new BarSeriesDefinition();
            sm.ItemMappings.Add(new ItemMapping("Y", DataPointMember.YValue));
            sm.ItemsSource = data;

            RadChart1.SeriesMappings.Add(sm);
        }

    }

    public class ChartData
    {
        public double X { get; set; }
        public double Y { get; set; }
    }
}
