piwik/piwik — pull request #7 by chmielot (2012-08-23 13:33:29+00:00)
Title: [#3341] Add possibility to pass custom plot properties in request eg. canvasLegend

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Tests pass: -
Fixes the following tickets: #3341
Todo: -
License of the code: MIT

Use case: The canvas legend of pie charts doesn't make sense, actually. Currently a canvas legend with the word "visits" is shown. This patch prepares piwik to customize plot parameters. Plot parameters that should be allowed to be customized need to be added to Piwik_ViewDataTable::init() to the protected $plotProperties variable. Plot options are then fully under control of PIWIK and if desires arise to customize other parameters as well, they can easily be added. Of course modifications to jqplot.js are unavoidable to $.extend() the default settings.

Please review and tell if you can think of better implementations. This one seems pretty straight forward and transparent to me.