示例#1
0
        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);
        }
示例#2
0
        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);
        }