private async void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e) { ////Pie Chart Data Source //ObservableCollection<PieData> PieDataCollection = new ObservableCollection<PieData>() //{ // new PieData() { Title = "Correctas", Value = 60 }, // new PieData() { Title = "Falladas", Value = 25 }, // new PieData() { Title = "Sin Contestar", Value = 5 } //}; //PieChart.DataSource = PieDataCollection; ////Line Chart Data Source //ObservableCollection<LineData> LineDataCollection = new ObservableCollection<LineData>() //{ // new LineData { Category = "E1", Line1 = 80, Line2 = 40, Line3 = 50 }, // new LineData { Category = "E2", Line1 = 50, Line2 = 70, Line3 = 40 }, // new LineData { Category = "E3", Line1 = 60, Line2 = 50, Line3 = 20 }, // new LineData { Category = "E4", Line1 = 10, Line2 = 30, Line3 = 50 }, // new LineData { Category = "E5", Line1 = 40, Line2 = 10, Line3 = 70 } //}; //LineChart.DataSource = LineDataCollection; estadisticas = await Comunicacion.getStatic(AplicationSettings.getToken()); if (estadisticas.test != null) { ObservableCollection <PieData> PieDataCollection = new ObservableCollection <PieData>(); PieDataCollection.Add(new PieData("Correctas", estadisticas.per_correcta)); PieDataCollection.Add(new PieData("Incorrectas", estadisticas.per_incorrecta)); PieDataCollection.Add(new PieData("No Respondidas", estadisticas.per_noRespondida)); PieChart.DataSource = PieDataCollection; ObservableCollection <LineData> LineDataCollection = new ObservableCollection <LineData>(); int i = 1; foreach (var a in estadisticas.test) { LineDataCollection.Add(new LineData { Category = "Test" + i, Line1 = a.correctasSobreCien(), Line2 = a.falladasSobreCien(), Line3 = a.sinResponderSobreCien() }); i++; } LineChart.DataSource = LineDataCollection; NotaMedia.Text = (double)(estadisticas.per_correcta / 10) + ""; TiempoMedio.Text = (double)(estadisticas.avg_tiempo / 1000) + " s"; } }