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

mstef’s picture

Nice find. Thanks -- I'll fix.

mstef’s picture