This report applies to the 1.0 branch as well, I believe.

If 0 data is included it is not shown on the chart. The effect is that the remaining non zero data values are shifted to the start of the array, leading to erroneous visualization. The following functions test for an empty string which is excluding out the 0 values:
- _fusioncharts_data_multi()
- _fusioncharts_data_combination()

The test is:

if ($value[$j] != '') {
  // build xml set string
}

I daresay that this check should be removed completely as the value has already past the isnumeric test at the top of the routines. If you are going to ignore values at this late stage then categories and possibly colors would need fixing as well. I've found that removing the checks works OK for me.

CommentFileSizeAuthor
#1 1256326-1-fusioncharts.module.patch2.72 KBmurrayw

Comments

murrayw’s picture

StatusFileSize
new2.72 KB

And here is the patch for the dev version.

murrayw’s picture

OK. I see how it works now. You are expecting numeric strings to be passed in. That's fine - I can fix my code for that. For me, 0 becomes '0'. No problems.

However, if you are going to go with that approach then I think you need to relax the logic in your code a little and allow for '' values to be passed in for situations where a blank string represents an unknown value. There are examples in the Fusion Charts Gallery which demonstrate unknown values being passed in. This is expressed in XML as an empty <set /> element. The Drupal module should be able to do this as well.

So, when checking for clean data see if the data is '' or numeric. Don't throw an error when '' is passed in. Later when it comes time for output you can check for '' and then just output <set />. This will ensure that the array values stay in their rightful places when rendering in the chart.