Looking at other examples, I see that the chart needs all the data sets at once and you cannot add them iteratively once they are ready. Am I wrong?
ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
...
dataSets.add(d1);
dataSets.add(d2);
...
LineData data = new LineData(dataSets);
mChart.setData(data);
My problem is that I hold the necessary data for the multiple LineDataSet in a database and access them through LiveData. To draw a single LineDataSet would be simple because I would write the logic of this inside stuff.observe{}.
stuff.observe(this, goodStuff -> {
Data data = generateData(goodStuff);
mChart.setData(data);
});
But now I have to observe multiple stuff and then set the data of multiple stuff to the chart. How to achieve this?