Closed (fixed)
Project:
Quant
Version:
7.x-1.0-beta4
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Feb 2013 at 21:34 UTC
Updated:
1 Mar 2013 at 14:26 UTC
The problem:
If you have a chart, that uses multiple lines (for example: the chart for "content creation by type") all lines will have the same color. I digged into the code and finally found the reason of this problem.
The reason
In line 249 of plugins/QuantChartChartAPI.inc the method palette returns a boolean instead of the array of colors. This happens, if the parameter $random is set to true.
return $random ? shuffle($palette) : $palette;
The function shuffle returns a boolean indicating whether the shuffling was successful or not. It doesn't return the shuffled array!
The solution
So instead of the line above the following code would work correctly:
if($random) shuffle($palette);
return $palette;
Comments
Comment #1
mstef commentedNice find. Thanks -- I'll fix.
Comment #2
mstef commentedhttp://drupalcode.org/project/quant.git/commit/261e397