Sign in to follow this  
premk

Overriding The Y Axis Display Points

Recommended Posts

Hi,

 

I am using Fusion charts for displaying data in graphical format. Fusion Charts automatically creats the Y Axis data points based on the data range we pass. My problem is that the value determined by Fusion is sometime not very presentable and I would like data points shown in the Y Axis to step as 100.00, 100.05, 100.20, 110.00 instead of 100.22, 100.31 and etc. I need a way to overide the datapoints by providing my one, how do I do this?

 

Also, I notice that lables adjacent to the 0 point gets overlapped with the label 0, is there a way to get around this issue?

 

Thanks

-Prem

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

I am using Fusion charts for displaying data in graphical format. Fusion Charts automatically creats the Y Axis data points based on the data range we pass. My problem is that the value determined by Fusion is sometime not very presentable and I would like data points shown in the Y Axis to step as 100.00, 100.05, 100.20, 110.00 instead of 100.22, 100.31 and etc. I need a way to overide the datapoints by providing my one, how do I do this?

 

Also, I notice that lables adjacent to the 0 point gets overlapped with the label 0, is there a way to get around this issue?

 

Thanks

-Prem

 

Hi,

 

Can you paste your XML code here? So that we can test?

Share this post


Link to post
Share on other sites

Please find the attached XML and screen shot.

 

<chart caption="GDP, Current Prices" subcaption="Values from past 5 years for the Country AUSTRALIA" xAxisName="QUARTERLY" yAxisName="AUST. $ MILLION, %1Y Growth Rate" showLabels="1" showColumnShadow="1" animation="1" showAlternateHGridColor="1" canvasPadding="10" valuePadding="7" yAxisValuesPadding="5" labelPadding="3" yAxisNamePadding="5" xAxisNamePadding="5" captionPadding="5" AlternateHGridColor="ff5904" divLineColor="ff5904" divLineAlpha="20" alternateHGridAlpha="5" borderAlpha="0" baseFontColor="666666" lineColor="ff7f3b" lineAlpha="85" showValues="0" decimalPrecision="2" rotateValues="1" valuePosition="auto" exportEnabled="1" numDivLines="4" adjustDiv="0" yAxisMinValue="-2.732" yAxisMaxValue="12.712" ><set label="Feb-2007" value="9.43" /><set label="May-2007" value="9.92" /><set label="Aug-2007" value="8.35" /><set label="Nov-2007" value="8.63" /><set label="Feb-2008" value="8.11" /><set label="May-2008" value="9.19" /><set label="Aug-2008" value="11.03" /><set label="Nov-2008" value="8.30" /><set label="Feb-2009" value="5.44" /><set label="May-2009" value="1.41" /><set label="Aug-2009" value="-1.05" /><set label="Nov-2009" value="0.78" /><set label="Feb-2010" value="4.10" /><set label="May-2010" value="9.62" /><set label="Aug-2010" value="10.12" /><set label="Nov-2010" value="8.97" /><set label="Feb-2011" value="7.29" /><set label="May-2011" value="6.71" /><set label="Aug-2011" value="6.38" /><set label="Nov-2011" value="5.51" /></chart>

 

post-27697-0-36563100-1341470084_thumb.png

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

If you want to customize the yAxisValues you would need to set y-axis limits and div lines explicitly.

 

The chart calculates the yAxisValues according to the numDivLines, yAxisMaxValue and yAxisMinValue attributes.

 

If you want your numbers on the chart to have trailing zeroes, you can set forceDecimals attribute as "1".

 

Ref. Code:

<chart ... numDivLines="3" yAxisMinValue="-2" yAxisMaxValue="12" forceDecimals ="1">

 

If you want to avoid overlapping, you would need to set chart dimensions accordingly.

 

Please find attached XML code and screen-shot for your reference.

post-24802-0-39080000-1341824723_thumb.png

Line2DData.xml

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for the quick respose. I tried the XML you shared and it worked for that set of data, whereas when I ran my application for other set of data ( XML attached below), I dont see the Y axis data points ending with Zeros. Please find the attached XML and chart image. I had set the forceDecimals to "1" and numDivLines to "3". You can let me know what is wrong with this XML.

 

Reg, the zero overlap, you wanted me to set the chart dimesnsions accordingly. Did you mean the chart Area Width and height that is set in the FusionCharts constructor? Can you explain more on it?

 

TIA,

Prem

 

post-27697-0-28858300-1341914600_thumb.png

sample.xml

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

FusionCharts charting engine internally calculates the y-axis values depending upon the data you provide to the respective attributes.

 

> numDivLines

> yAxisMinValue

> yAxisMaxValue

 

If you want to display zero after the decimal place, you can use following work-around:

 

Ref. Code:

<chart ... formatNumber='1' formatNumberScale='0' yAxisValueDecimals='2'>

 

This configuration will also work according to the data that you pass to the chart.

 

Setting chart dimensions means configuring the width and height of the chart in the FusionCharts constructor.

 

Hope this helps.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this