MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

How to customize the label for x axis?

Open KiBa1215 opened this issue 10 years ago • 3 comments

I'm finding all around, and still have no idea how to change the values of x-axis, using CubicLineChart. Could anyone tell me how to do it ?

KiBa1215 avatar Jul 12 '16 10:07 KiBa1215

Hi Phil

I was also trying to set custom labels along the X-Axis (using a String for the date) as per the example given in the wiki (https://github.com/PhilJay/MPAndroidChart/wiki/Setting-Data)

(my code...) ArrayList xStrings = new ArrayList<>(); ... BarData data = new BarData(xStrings, dataSets);

but it appears this has changed with version 3.0. How do I achieve the same result with rel. 3.0 ?

Thanks, Simon

plthatfunkymusic avatar Jul 13 '16 09:07 plthatfunkymusic

Use the AxisValueFormatter interface.

Refer to the example project until the documentation is updated.

PhilJay avatar Jul 13 '16 09:07 PhilJay

Thanks, I'll check it out. Thanks for speedy response, appreciated.

plthatfunkymusic avatar Jul 13 '16 09:07 plthatfunkymusic