Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
2.0 kB
2
Indexable
Never
 Bundle extras = getIntent().getExtras();

        ArrayList<Integer> sleepScores = extras.getIntegerArrayList("SleepScores");
        ArrayList<Integer> foodScores = extras.getIntegerArrayList("FoodScores");
        ArrayList<Integer> moodScores = extras.getIntegerArrayList("MoodScores");


        ArrayList<BarEntry> sleepBarEntries = new ArrayList<>();

        for(int i = 0; i < sleepScores.size(); i++)
        {
            sleepBarEntries.add(new BarEntry(i,(float)sleepScores.get(i)));
        }
       // barEntries.add(new BarEntry(1,40f));
       // barEntries.add(new BarEntry(2,44f));
       // barEntries.add(new BarEntry(3,30f));
        //barEntries.add(new BarEntry(4,36f));


        ArrayList<BarEntry> moodBarEntries = new ArrayList<>();

        for(int i = 0; i < moodScores.size(); i++)
        {
            moodBarEntries.add(new BarEntry(i,(float)moodScores.get(i)));
        }
        //barEntries2.add(new BarEntry(1,44f));
        //barEntries2.add(new BarEntry(2,54f));
        //barEntries2.add(new BarEntry(3,60f));
        //barEntries2.add(new BarEntry(4,31f));

        ArrayList<BarEntry> dietBarEntries = new ArrayList<>();

        for(int i = 0; i < foodScores.size(); i++)
        {
            dietBarEntries.add(new BarEntry(i,(float)foodScores.get(i)));
        }
       // barEntries3.add(new BarEntry(1,50f));
       // barEntries3.add(new BarEntry(2,20f));
       // barEntries3.add(new BarEntry(3,70f));
       // barEntries3.add(new BarEntry(4,29f));

        BarDataSet barDataSet = new BarDataSet(sleepBarEntries, "Sleep Scores");
        barDataSet.setColors(ColorTemplate.COLORFUL_COLORS);

        BarDataSet barDataSet2 = new BarDataSet(moodBarEntries, "Mood Score");
        barDataSet2.setColors(ColorTemplate.MATERIAL_COLORS);

        BarDataSet barDataSet3 = new BarDataSet(dietBarEntries, "Diet Score");
        barDataSet3.setColors(ColorTemplate.JOYFUL_COLORS);