The attached patch fixes:

* an issue where in ",|" was being passed in the url when using xy-line charts
* an issue where legitimate 0 values were being converted to -1. The patch checks for type null rather than a false

Comments

tjholowaychuk’s picture

Assigned: Unassigned » tjholowaychuk
xen’s picture

I've run into the same 0 value problem. I've fixed it by doing:

if ($v !== 'NULL'){

Instead of:

if ($v != 'NULL'){

In _chart_encode_data.

sivaji_ganesh_jojodae’s picture

StatusFileSize
new19.71 KB

patch works

andyceo’s picture

Version: 6.x-1.x-dev » 5.x-1.1-1
StatusFileSize
new12.91 KB
new23.2 KB

I spend a lot of time to find why my pie diagramm is drawning incorrectly.

I have this data for diagramm (after adjusting resolution):

array(6) {
  [0]=>
  float(99)
  [1]=>
  float(24)
  [2]=>
  float(8)
  [3]=>
  float(17)
  [4]=>
  float(75)
  [5]=>
  float(0)
}

After $data['chd'] = 't:' . _chart_encode_data($chart['#data']); in function chart_build($chart) in file chart.module in line 285, I have the following encoded data:

array(1) {
  ["chd"]=>
  string(18) "t:99,24,8,17,75,-1"
}

And the diagramm looked WRONG.

After applying this patch in the file chart.module in line 384:

if ($v != 'NULL'){ --> if ($v !== 'NULL'){

Diagramm looks RIGHT.

So, please, commit this very needed patch!

andyceo’s picture

Version: 5.x-1.1-1 » 6.x-1.x-dev
Priority: Normal » Critical

Forget to change the version.

jeremy’s picture

Subscribe.

andyceo’s picture

Version: 5.x-1.1-1 » 6.x-1.x-dev
Assigned: tjholowaychuk » Unassigned

Dear boombatower,

please, commit fixes for that bug!

13rac1’s picture

13rac1’s picture

Status: Needs review » Fixed
  1. "an issue where in ",|" was being passed in the url when using xy-line charts" - Please re-open if this is still a problem
  2. "An issue where legitimate 0 values were being converted to -1." - This has been fixed in 6.x-1.x and 7.x-1.x using the patch linked in #8.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.