using System; using Telerik.Web.UI; using Telerik.Charting; using System.Collections.Generic; using WakeMeUp.basicas; namespace WebApplication1 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { List pesos = new List(); pesos.Add(new Peso(185, new DateTime(2009, 2, 2))); pesos.Add(new Peso(84.5, new DateTime(2009, 3, 2))); pesos.Add(new Peso(83.45, new DateTime(2009, 4, 2))); pesos.Add(new Peso(80.790, new DateTime(2009, 5, 2))); this.criarGrafico(pesos); } private void criarGrafico(List pesos) { RadChart radChart = new RadChart(); radChart.ChartTitle.TextBlock.Text = "Gráfico Peso"; radChart.Skin = "DeepBlue"; ChartSeries chartSeries = new ChartSeries(); chartSeries.Name = "Peso"; chartSeries.Type = ChartSeriesType.Line; for (int i = 0; i < pesos.Count; i++) { string data = pesos[i].Data.Day +"/"+ pesos[i].Data.Month +"/"+ pesos[i].Data.Year; chartSeries.AddItem(pesos[i].Kilogramas, data); } radChart.Series.Add(chartSeries); this.Page.Controls.Add(radChart); } } }