Bad Whippet

Y Axis Minimum value is being ignored (Free Charts)

Recommended Posts

Hi - I'm using the very brilliant Fushion Charts Free and am trying to put together a multi-series line chart (FCF_MSLine.swf) with data loaded via ASP.  It charts 'actual' and 'target' square meterage for the next few years.

<graph caption='Square Meterage' subcaption='(from Apr 2007 to Apr 2012)

post-1445-128441565303_thumb.jpg

Edited by Guest

Share this post


Link to post
Share on other sites
Here we go.  As said, this is generated by ASP from a SQL database where later 'actual' values are all null.  Additionally, the very first 'target' value is null too, and I suspect this is the cause......

<graph caption='TOTAL SQUARE METERS' subcaption='(from Oct 2007 to Apr 2012)' bgColor='DDE3D5' hovercapbg='FFECAA' hovercapborder='F47E00' baseFontSize='10' showshadow='1' shadowAlpha='50' shadowThickness='4' shadowYShift='3' animation='1' showvalues='0' numdivlines='9' numVdivlines='0' yAxisMinValue='30000' yaxismaxvalue='45000'  rotateNames='1' anchorRadius='5' anchorBorderThickness='2'>

<categories ><category name='Oct 07' /><category name='Feb 08' /><category name='May 08' /><category name='Apr 09' /><category name='Apr 10' /><category name='Apr 11' /><category name='Apr 12' /></categories>

<dataset seriesName='Target' color='F1683C' anchorBorderColor='F1683C' anchorBgColor='FFFFFF'><set value='' /><set value='37268' /><set value='36330' /><set value='36330' /><set value='36330' /><set value='36330' /><set value='36330' /></dataset>

<dataset seriesName='Actual' color='1D8BD1' anchorBorderColor='1D8BD1' anchorBgColor='1D8BD1' showOnTop='1'><set value='40375' /><set value='' /><set value='' /><set value='' /><set value='' /><set value='' /><set value='' /></dataset></graph><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

 

 

 

When FusionCharts encounters a null value, it treats it as 0 with a flag to not show it. As such, during checking your specified minValue (25000) is invalidated against this value of 0. So, you might just change your null values to 25000.

Share this post


Link to post
Share on other sites

Trouble is: when I change my nulls to the minimum 25000, this gives me an incorrect result: it plots a false line that plummets to 25000 for all future years when there should be no line at all for the future years (as per the chart in my first post). 

I've tried a formula that tests for null values and doesn't add a <set> tag as soon as nulls are encountered, preventing the line from travelling any further.  It's basic, but it works for this graph because nulls happen only in the later <set> tags.

Unfortunately, it doesn't work for my 'target' line where the first <set> in the series is a null but later values are not.  Although not accurate, I could make this missing 'target' value the same as the 'actual' for this first <set> but want to ask a dumb question first: if I DID make all my null values be my minimum 25000, is there a way I can code a <set> not to be plotted on the graph (ie remain hidden so no line is plotted)?

Share this post


Link to post
Share on other sites

I hate to necro-post, but Sudipto's solution does not work. Fusion charts sets "alpha=0" values to null and then treats them as zero and resets yAxisMinValue. I'm not familiar with any programming standard where null = 0, so I don't understand why this is not treated as a bug. It ruins an otherwise perfectly good chart. Does anyone at least have a good workaround or fix for this? I have made a few attempts to no avail.

Share this post


Link to post
Share on other sites

Hi,

 

 

 

In FusionCharts Free, empty data is accepted in two ways:

 

 

 

[set alpha='0' ... /] (for backward compatibility)

 

and [set /] (new version)

 

 

 

So, whenever an empty data is found, the chart auto calculates its own limits.

Share this post


Link to post
Share on other sites

Well I have the paid version of fusion charts and I do know how to enter empty data.

 

 

 

So, whenever an empty data is found, the chart auto calculates its own limits.

 

 

 

 

I guess my question is, what is the purpose of this functionality? If I set the yAxisMinValue='10' and enter an empty value, the Y axis should remain at 10. Empty values are not graphed, so autoscaling the axis does not seem to serve any purpose except to make the charts behave in unexpected ways. This seems like a bug to me, unless I am missing something.

Edited by Guest

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