1
votes

I ma using MPAndroidChart bubble chart. when I run the app it shows x axis values hidden. like I have x-axis label January, February, march, April, may,june. but when app run it shows January , April and June. on double tape on label it zoom the chart and show hidden labels. I want to show all in a sequence so that user troll horizontal and view all. no need to double tap

3

3 Answers

2
votes

You can determinate the numbers of labels to display. This prevents them from hiding automatically.

XAxis xAxis = bubbleChart.getXAxis();
xAxis.setLabelCount(data.length);
1
votes

Not sure why would you do that. The library does a great job in automatically deciding how many labels to show on either X or Y axis to make the chart nice and readable.

If the chart is narrow, it might happen that your values will overlap, that's why the library skips a few, to make the chart look good.

If that still doesn't help, you can play around with the spacings between axis labels - check out the library's documentation for these specific items

Other solution may be to rotate the labels of the X axis with the help of

xAxis.setLabelRotationAngle(35); 
0
votes

I found the solution after expanding MP Android Chart documentation. you can do so set thee labels to skip 0. It will skip no label from xAxis.

XAxis xAxis = bubbleChart.getXAxis();
xAxis.setLabelsToSkip(0);