Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCChart3D for Java
 controlling digits past decimal point using SCINot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Peter

17 Posts

Posted - 16 Jun 2010 :  18:45:54  Show Profile  Reply with Quote
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 work--in 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 numbers--between 10**12 to 10**26...

Thanks for any insight.

quinncurtis

1534 Posts

Posted - 17 Jun 2010 :  09:31:17  Show Profile  Reply with Quote
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);


Go to Top of Page

Peter

17 Posts

Posted - 03 Jul 2010 :  19:12:44  Show Profile  Reply with Quote
Thanks!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07