Display Percentage/Dollar Sign in Range Axis values
Display Percentage/Dollar Sign in Range Axis values
Is anyone aware of how to display the Range Axis labels as percentage(percentage next to the number it displays) ... I tried setNumberFormatOverride of Number Axis to NumberFormat.getPercentInstance()... But that was displaying some other percentage(0%,500%,1000%) instead of the values that were input...
Re: Display Percentage/Dollar Sign in Range Axis values
Did you try it by setting the range?
Re: Display Percentage/Dollar Sign in Range Axis values
Try dividing your values by 100.
Re: Display Percentage/Dollar Sign in Range Axis values
Thanks remiohead.... But how to display the dollar sign in the Range Axis??
Re: Display Percentage/Dollar Sign in Range Axis values
Code: Select all
NumberFormat nf = NumberFormat.getInstance();
if(nf instanceof DecimalFormat) {
((DecimalFormat)nf).applyPattern("$");
}
Re: Display Percentage/Dollar Sign in Range Axis values
waw...Thanks... It helped me...
One more question....How do I display the Range axis with double(type) values along with this dollar sign.... When i use NumberFormat.getInstance(), it creates only Integer value I guess... Also tried setting setMaximumFractionDigits to 2...But it dint work...

One more question....How do I display the Range axis with double(type) values along with this dollar sign.... When i use NumberFormat.getInstance(), it creates only Integer value I guess... Also tried setting setMaximumFractionDigits to 2...But it dint work...
Re: Display Percentage/Dollar Sign in Range Axis values
Almost had it. Use setMinimumFractionDigits(2) too.
Re: Display Percentage/Dollar Sign in Range Axis values
But that too dint work...
I did the below.

I did the below.
Code: Select all
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(2);
nf.setMinimumFractionDigits(2);
if(nf instanceof DecimalFormat) {
((DecimalFormat)nf).applyPattern("$");
}
rangeNumAxis.setNumberFormatOverride(nf);