Allow charts to track click events and perform a certain action. The action taken can be:
Open Flash Chart does support on-click events (see Open Flash Chart On-click).
I propose adding support for a "special" column (like "label"), say "click_url", which Piwik's widgetize module would recognize and add on-click functionality to the chart. Each data value in that column would either be a JS function, a URL or a [module,action] pair (for datafile).
I think adding interactivity to the charts would be a great feature!
Keywords: chart, graph
Attachment: on-click support in pie charts
Pie.php.patch
Piwik already uses this feature but does not expose it as a general purpose feature to widget authors.
"Datafile" isn't possible with the current version of OFC2.
URL is already supported by the Evolution chart. See Piwik_Visualization_Chart->setAxisXOnClick().
anush, did you try using Piwik_Visualization_Chart->setAxisXOnClick() ?
Does it work as expected for you? if yes, we could close the ticket.
I did take a look after vipsoft mentioned it. I wasn't having too much luck with it for my development purposes. Then again, my dev environment is in bit of disarray at the moment. Give me another day or two -- I can delve a bit more deeper and definitively say "yay" or "nay".
Thanks for your diligence.
Ok, here are my thoughts...
Piwik_ViewDataTable_GenerateGraphData_ChartEvolution->initChartObjectData()
#!php
// %s is dynamically replaced by the value in the specified column (in this case, "label")
setAxisXOnClickURL('http://example.com?page=%s', 'label');
setAxisXOnClickJS('alert(%s)', 'label');
1- agreed. Would you be able to provide a patch for this?
2- patch looks good, we can commit, let's wait for 1) and 3)
3- again, agreed with the concept. if you are able to provide a patch for this, it would help getting it done.