I was getting the same problem as you. I have a histogram, when all y values โโare 0, the panel does not appear at all. but if there is at least one y value that is not 0, a bar is displayed, even the rest of the y values โโare 0.
so I think this is a bug from MPAndroidChart.
but I found a way to tweak it a bit. you need to set a fixed value for the maximum axis when all y values โโare 0.
here is the code to set the value of the fixed maximum axis:
leftAxis.setAxisMaxValue(100f);
doing this when all y values โโare 0, you set the maximum axis value to 100, but you can set it to another value as long as the maximum axis value is not 0, and the histogram will show even if all y values โโare 0.
hope it fixes your problem.
source share