public HAReport AppointmentFromJson() { var report = new HAReport(); // deserialize JSON directly from a file using (StreamReader file = new System.IO.StreamReader(LoadResourceStream())) { var json = file.ReadToEnd(); report = JsonConvert.DeserializeObject <HAReport>(json); } return(report); }
public ChartData SetChartValues(string chartType) { HAJsonManager hAJsonManager = new HAJsonManager(); HAReport appointmentFromJson = hAJsonManager.AppointmentFromJson(); ChartData chartData = new ChartData(); switch (chartType) { case "bmi": // BMI chart Values var historic = appointmentFromJson.graphs.body_composition.bmi.historic; chartData = GetData(historic); break; case "body_fat": // BMI chart Values historic = appointmentFromJson.graphs.body_composition.body_fat.historic; chartData = GetData(historic); break; } return(chartData); }