user2638558
user2638558

Reputation: 13

Android Achartengine Bar Chart Value Format

Is there way I can change the bar chart value from something like 1000000 to $1,000,000 (value at the top of the bar)? I didn't find a way to set this value as string.

Thanks for your help.

Upvotes: 0

Views: 389

Answers (1)

Renjith
Renjith

Reputation: 3617

Here is what you can do.

Set the number formatter

mRenderer.setLabelFormat(new DecimalFormat("#,###"));

Set axis title

mRenderer.setYTitle("Values in $");

Or you could try this method of XYMultipleSeriesRenderer

addYTextLabel(double yValue, java.lang.String text, int the rendererScale)

Try setting '$1,000,000' as the second argument and check the output. I haven't tried it before. Give it go and see if that helps.

Upvotes: 1

Related Questions