Author 
Topic 

Peter
17 Posts 
Posted  16 Jun 2010 : 18:45:54

I'm trying to control the display of Numeric Axis Labels, namely the number of digits to the right of the decimal place. I'm using setAxisLabelsFormat(NumericalAxisLabels.SCIENTIFICFORMAT) which behaves on a linear scale axis but adds numerous decimal places when I change the axis to log scale.
I tried using setAxisLabelsDecimalPos(2) but that didn't workin fact it made it worse! Without this call on a linear scaled axis, the labels were truncated one place past the decimal. With the call, it added 26 places past the decimal.
With the call to setAxisLabelsDecimalPos(2) on a log scale axis, it started at 13 decimal places and with each successive tick, it added another decimal place to the tick's label until it got to the end of the axis with 26 decimal places.
The data consists of large numbersbetween 10**12 to 10**26...
Thanks for any insight.


quinncurtis
1534 Posts 
Posted  17 Jun 2010 : 09:31:17

The setAxislabelsDecimalPos method does not set the number of decimals displayed, it sets the precision of the number.
For a log axis, if you are plotting data in the range of 10^26, try a value of 26.
yAxisLab1.setAxisLabelsDecimalPos(26);
This will keep all of the axis labels at a value 1E12, 1E13,...,1E26
Or you can use EXPONENTFORMAT format and set the decimal precision to 99. yAxisLab1.setAxisLabelsFormat(ChartConstants.EXPONENTFORMAT); yAxisLab1.setAxisLabelsDecimalPos(99);



Peter
17 Posts 
Posted  03 Jul 2010 : 19:12:44

Thanks! 



Topic 


