@julienmoumne opened this issue on March 4th 2013

The Static PNG Graphs APIcurrently supports a maximum of 6 colours (PieGraph.php#L34 & GridGraph.php#L54).

Trying to plot more than 6 elements (filter_limit > 6 or $columns => 6) results in the following notices :

 Notice:</strong> <i>Undefined index: GRAPHIC_COLOR9</i> in <b>/home/piwik/www/plugins/ImageGraph/StaticGraph/GridGraph.php</b> on line <b>80</b>
      7             Notice:</strong> <i>Undefined index: GRAPHIC_COLOR9</i> in <b>/home/piwik/www/plugins/ImageGraph/StaticGraph/GridGraph.php</b> on line <b>270</b>
      7             Notice:</strong> <i>Undefined index: GRAPHIC_COLOR8</i> in <b>/home/piwik/www/plugins/ImageGraph/StaticGraph/GridGraph.php</b> on line <b>80</b>
      7             Notice:</strong> <i>Undefined index: GRAPHIC_COLOR8</i> in <b>/home/piwik/www/plugins/ImageGraph/StaticGraph/GridGraph.php</b> on line <b>270</b>
      7             Notice:</strong> <i>Undefined index: GRAPHIC_COLOR7</i> in <b>/home/piwik/www/plugins/ImageGraph/StaticGraph/GridGraph.php</b> on line <b>80</b>
      7             Notice:</strong> <i>Undefined index: GRAPHIC_COLOR7</i> in <b>/home/piwik/www/plugins/ImageGraph/StaticGraph/GridGraph.php</b> on line <b>270</b>
      7             Notice:</strong> <i>Undefined index: GRAPHIC_COLOR10</i> in <b>/home/piwik/www/plugins/ImageGraph/StaticGraph/GridGraph.php</b> on line <b>80</b>
      7             Notice:</strong> <i>Undefined index: GRAPHIC_COLOR10</i> in <b>

The API should either : - output an explicit error message - support more colours, 10 should be enough, with an explicit error message when trying to plot more elements - support an unlimited amount of colors

@mattab commented on March 11th 2013

a Proposal: - define 10 colors - Throw error if more than 10 plotted (does not make sense to do that anyway)

Powered by GitHub Issue Mirror