I am not sure what you want? If you set round to nearest 10 to the -2, you will get two decimal
places. When using percent signs, remember you multiply the values by 100, so a value of .156 on
your axis is displayed as a percent is: 16.00%, as first the value is rounded to .16, then
converted to a percent.
Alls that code is doing is if you are rounding to a power greater than or equal to 10 ^ 0, we do
not show decimal places as they will always be zeroes.
--- Vikram Rajan <vr...@st...> wrote:
> If I use the dataAxisProperties.setUsePercentSigns() to set the percent signs on the data axis,
> I always get the format of the labels as 10.00%, 20.00%, which is not really what the developer
> would want in normal cases. I am using a user-defined scale here. A snapshot of the code ...
>
> DataAxisProperties dataAxisProperties = (DataAxisProperties)
> axisProperties.getYAxisProperties();
> dataAxisProperties.setUsePercentSigns(true);
> dataAxisProperties.setNumItems(20);
> dataAxisProperties.setUserDefinedScale(0, 0.1);
> dataAxisProperties.setRoundToNearest( -2 );
>
> I looked into the code for the NumericTagGroup and found the lines that were causing it (lines
> 118 to 129). Reproduced the code below.
>
> //---TRIM OFF DECIMAL PLACES IF ROUND TO WHOLE NUMBER
> if( roundingPowerOfTen >= 0 )
> {
> numberFormat.setMaximumFractionDigits( 0 );
> numberFormat.setMinimumFractionDigits( 0 );
> }
> else
> {
> numberFormat.setMaximumFractionDigits( -roundingPowerOfTen );
> numberFormat.setMinimumFractionDigits( -roundingPowerOfTen );
> }
>
>
> What I suggest is that we change the minimum fraction digits to be zero when the rounding power
> of ten is less than zero. This will ensure that if the computed increment is a whole number, the
> data axis labels will not be displayed as fractions. Nathan, what do you think?
>
> - Vikram Rajan
>
=====
http://nathaniel-auvil.blog-city.com/
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
|