21

I'm developing some chart features using MPAndroidChart library.

Is there any way to display all the xaxis values I added? Seems that the library will auto calculate on xaxis, some of values will be hidden. ex. display date: 05-17 05-17 05-15 .... the same day 05-17 will not shown.

thanks!

bchang
  • 215
  • 1
  • 2
  • 6

2 Answers2

49

Check out the documentation of the XAxis.

And the method setLabelsToSkip(...). If you set that to 0, none of the labels in your x-axis will be skipped during rendering.

Update v3.0.0

As of this release, the x-axis is treated equally to the y-axis. If you want to display all labels, you can do so by using the axis.setLabelCount(...) method.

Philipp Jahoda
  • 50,880
  • 24
  • 180
  • 187
2

Get the number of items as an int from your dynamic list and use in setLabelCount

SABANTO
  • 1,316
  • 9
  • 24