Json zhang
Json zhang

Reputation: 129

how to hide the top `xAxis lables` of mpandroidchart line chart?

I use mpandroidchart, I set the xAxis position as bothside ,and set the lable, the code :

xAxis.setPosition(XAxisPosition.BOTH_SIDED);
xAxis.setDrawLabels(true);

but I want only show the bottom xAxis lables and hide the top xAxis lables. how can I do for what I want?

enter image description here

enter image description here

Upvotes: 4

Views: 2344

Answers (1)

Dhruv
Dhruv

Reputation: 1799

Try with this:

dataSet.setDrawValues(false);

Check this link for more details.

Edit 1:

Replace

xAxis.setPosition(XAxisPosition.BOTH_SIDED);

With

xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);

Edit 2:

Try to add:

xAxis.disableGridDashedLine();

Upvotes: 2

Related Questions