0

I'm using MPAndroid chart to display a line chart.

The chart is updated with different data and of course, when the data changes, the y-axis lines and the zoom level is changed because of the different sets of input data.

Is there any way to maintain the position of the y-axis lines and only change their labels according to the new data?

Thanks!

adriennoir
  • 1,329
  • 1
  • 15
  • 29

1 Answers1

1

After a lot of tries and investigations, it seems that I found a solution just after posting the question.

Just in case someone else needs this, I used the setLabelCount function before but never the one with the force parameter. The solution is:

mChart.getAxisLeft().setLabelCount(visibleYCount, true);

Forcing the label count will assure the number of y-axis lines and thus, their position is stable with different data sets.

adriennoir
  • 1,329
  • 1
  • 15
  • 29