formatting X-axis labels to n decimal points
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



formatting X-axis labels to n decimal points Expand / Collapse
Author
Message
Posted 3/3/2008 12:32:08 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/6/2008 8:55:37 PM
Posts: 3, Visits: 9
Hi, I am new to FusionCharts. I am graphing a multi-series 2d line graph, in which the x-axis labels contain very small ecimals. I wish to keep the value on the decimals(i.e. no rounding), but to round their display on the x-axis. I wasn't able to find a switch suitable for this in the manual.

For e.g., i may pass the following xml for a multi-series 2d line chart,

categories
category label='0.04111111'
category label='0.04211111'
category label='0.04311111'
category label='0.04611111'
category label='0.05'
categories

dataset seriesName='s1'
set value='1'
set value='2'
set value='3'
set value='4'
set value='5'
dataset

dataset seriesName='s2'
set value='2'
set value='3'
set value='4'
set value='5'
set value='6'
dataset


i wish to see the x-axis labels rounded to 2 decimal points (not 3 or more due to space constraints), but retain their unrounded values as far as graphing is concerned.

That is, i would like to see the x-axis lablels: 0.04, 0.04, 0.04, 0.05, 0.05, but i still want to see the s1 and s2 data as though they are plotted against the true x-axis values passed, 0.04111111, 0.04211111 etc, like this,

                        4
                        3
            3
            2
2
1

0.04     0.04     0.04 ......


how can i achieve this?

would i be able to do the same for the Y-axis ?

thanks
Post #4858
Posted 3/4/2008 7:12:42 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 10/3/2008 2:42:18 AM
Posts: 2,117, Visits: 498
Hi,

x-axis labels are treated as strings in FusionCharts, and as such you cannot round them.


Thanks,
Pallav Nadhani
FusionCharts Team
Post #4896
Posted 3/5/2008 12:13:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/6/2008 8:55:37 PM
Posts: 3, Visits: 9
thank you.

Still on 2d multi-series line graphs, how can i configure vertical div lines to show whenever there is a corresponding x-axis label displayed ?

for e.g. i may pass the following xml,

categories
category label='5'
category label='10'
category label='15'
category label='20'
category label='25'
categories

in this case since there are only 5 x-axis labels, i want to show all 5, and therefore want 3 div lines (2 lost to the left and right edges of the graph).

if the number of categories grows big, i may wish to display only every Nth label. I know i can use "labelStep" to do this. But then, how can i guarantee that 1 vertical div line will appear for every label displayed?


thanks again!
Post #4928
Posted 3/6/2008 12:26:13 PM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 10/3/2008 2:42:18 AM
Posts: 2,117, Visits: 498
In that case you'll have to back-calculate in your XML generation script and provide the vlines and labelStep accordingly.

Thanks,
Pallav Nadhani
FusionCharts Team
Post #4966
Posted 3/6/2008 4:31:38 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/6/2008 8:55:37 PM
Posts: 3, Visits: 9
thanks for confirming.

Another question on the same type of graph, I'm currently using adjustDiv=0, since it seems to give me better Y-axis values than adjustDiv=1. I would further like to force the Y-axis labels to show 2dp, in the same fashion as decimals=2 and forceDecimals=1 does on the data plots.

So for e.g., currently i get the following Y-axis labels / values,

0 / 1.75 / 3.5 / 5.25 / 7

and i wish to see them as,

0.00 / 1.75 / 3.50 / 5.25 / 7.00
Post #4984
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 3:59pm


Execution: 0.094.