Download & Extend

formatting error for xy line charts, and issue with data that is equal to 0

Project:Google chart API
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

AttachmentSize
chart.module.patch538 bytes

Comments

#1

Assigned to:Anonymous» tjholowaychuk

#2

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.

#3

patch works

AttachmentSize
Screenshot.png 19.71 KB

#4

Priority:normal» critical

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!

AttachmentSize
chart_good.png 23.2 KB
chart_bad.png 12.91 KB

#5

Version:5.x-1.1-1» 6.x-1.x-dev

Forget to change the version.

#6

Subscribe.

#7

Assigned to:tjholowaychuk» Anonymous

Dear boombatower,

please, commit fixes for that bug!

#8

#9

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.

#10

Status:fixed» closed (fixed)

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