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

jhedstrom - April 11, 2008 - 18:03
Project:Chart API
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs review
Description

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

#1

tjholowaychuk - April 14, 2008 - 14:43
Assigned to:Anonymous» tjholowaychuk

#2

Xen.dk - January 9, 2009 - 13:41

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

sivaji - January 13, 2009 - 18:27

patch works

AttachmentSize
Screenshot.png 19.71 KB

#4

andyceo - September 18, 2009 - 13:27
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

andyceo - August 29, 2009 - 15:16
Version:5.x-1.1-1» 6.x-1.x-dev

Forget to change the version.

#6

Jeremy - September 10, 2009 - 16:14

Subscribe.

#7

andyceo - October 22, 2009 - 18:48
Assigned to:tjholowaychuk» Anonymous

Dear boombatower,

please, commit fixes for that bug!

 
 

Drupal is a registered trademark of Dries Buytaert.