Ejemplo n.º 1
0
        private void CreateCaloriesGraph(int numberOfEntries)
        {
            var calories   = json.DeserializeKalorienTag();
            var jsonLenght = calories.Count;

            MyValues.Clear();
            TypeOfGraph.Title = "Kalorien";


            if (calories.Count == 0)
            {
                return;
            }
            var helper = jsonLenght - numberOfEntries - 1;

            for (int i = 0; i <= numberOfEntries - 1; i++)
            {
                if (i >= jsonLenght)
                {
                    break;
                }

                if (jsonLenght <= numberOfEntries)
                {
                    MyValues.Add(new ObservableValue(calories[i].CaloriesDay));
                }
                else
                {
                    MyValues.Add(new ObservableValue(calories[helper + i].CaloriesDay));
                }
            }
        }
Ejemplo n.º 2
0
        private void CreateWeightGraph(int numberOfEntries)
        {
            var weight     = json.DeserializeGewichtTag();
            var jsonLenght = weight.Count;

            MyValues.Clear();
            TypeOfGraph.Title = "Gewicht";

            if (jsonLenght == 0)
            {
                return;
            }
            var helper = jsonLenght - numberOfEntries - 1;

            for (int i = 0; i <= numberOfEntries - 1; i++)
            {
                if (i >= jsonLenght)
                {
                    break;
                }

                if (jsonLenght <= numberOfEntries)
                {
                    MyValues.Add(new ObservableValue(weight[i].TodaysWeight));
                }
                else
                {
                    MyValues.Add(new ObservableValue(weight[helper + i].TodaysWeight));
                }
            }
        }