|
From: Nathaniel G. A. <nat...@ya...> - 2003-05-06 03:24:13
|
you set the rounding to the nearest whole number, 10 to the zero'th power. java.util.NumberFormat
will round your increment to the nearest whole number, or 100%. Set the rounding to -2 and remove
the user defined scale to see a 'good fitting' scale.
--- Vikram Rajan <vr...@st...> wrote:
> This question is borne of my inability to understand fully the scale calculation algorithm. I am
> trying to get a scale on the Y Axis that starts from 0 and has labels at increments of 5. This
> is to be used along with usePercentSigns(true). How do I set the increment value and the
> rounding power of ten to make this work?
>
> Currently, my code looks like this:
>
> double[][] data = new double[][]{ { 0.40, 0.60 } };
> .................
> DataAxisProperties dataAxisProperties= (DataAxisProperties)
> axisProperties.getYAxisProperties();
> dataAxisProperties.setUsePercentSigns(true);
> dataAxisProperties.setUserDefinedScale( 0, 0.05 );
> dataAxisProperties.setRoundToNearest( 0 );
> ..................
>
> I am attaching the chart that this has produced.
>
> Is this possible given the default algorithm? Or do I need to write a custom scale calculator?
> If I do, some pointers would be greatly appreciated.
>
> thanks
> Vikram
>
>
>
> ATTACHMENT part 2 application/octet-stream name=yesno.jpg
=====
http://nathaniel-auvil.blog-city.com/
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
|