Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to select metrics in custom evolution charts. #3008

Closed
anonymous-matomo-user opened this issue Mar 5, 2012 · 5 comments
Closed
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. worksforme The issue cannot be reproduced and things work as intended.

Comments

@anonymous-matomo-user
Copy link

I have created a plugin to generate an evolution chart for some custom data. The code is as follows

class Piwik_MultplxAnalytics_Controller extends Piwik_Controller{

function CustomerJourneysGraph(){
$this->GetDateRange();
$view = Piwik_ViewDataTable::factory('graphEvolution');
$view->init( $this->pluginName, __FUNCTION__, 'MultplxAnalytics.GetCustomerJourneys' );
return $this->renderView($view);

}

}

This creates a chart with several lines on it. I would like to be able to turn those lines on and off individually for clarity. I've installed Piwik 1.7, and I know that there's a way of doing it with Piwik 1.7, but after 2 days of examining the codebase, I've not been able to work out how to do it. I think I need to invoke the function Piwik_ViewDataTable_GenerateGraphData_ChartEvolution->addRowPicker(), but I can't work out how to access this from my code, of what to use as its argument.

Please create some documentation for this
Keywords: charts,evolution,picker,documentation

@timo-bes
Copy link
Member

timo-bes commented Mar 6, 2012

The graphs provide two mechanisms:

  1. A metrics picker (that appears on all core graphs) to select the available metrics.
  2. A mechanism where external series pickers can hook into. We're still working on this one for a feature called row evolution.

Which of them do you want? The picker inside the graph or toggeling the series from the outside?

@mattab
Copy link
Member

mattab commented Mar 6, 2012

I think mechanism 1) Metrics picker
would be the easiest and the feature that plugin developers would re-use.

@anonymous-matomo-user
Copy link
Author

I've now modified the code to read

function CustomerJourneysGraph(){
   $this->GetDateRange();
   $shops=array_keys($this->dimensions);
   $view = $this->getLastUnitGraphAcrossPlugins( $this->pluginName,  __FUNCTION__, $shops, $shops, false, 'MultplxAnalytics.GetCustomerJourneys' );
   return $this->renderView($view);

 }

This creates a chart with a series picker, but when I deselect individual lines, nothing happens.

@mattab
Copy link
Member

mattab commented Mar 21, 2012

See also another report maybe related? where a user does not know how to fix his code http://forum.piwik.org/read.php?6,87442

@mattab
Copy link
Member

mattab commented Mar 11, 2013

we'll review this as well as other aspects of plugins API in next few months.

@anonymous-matomo-user anonymous-matomo-user added this to the Official Piwik Plugins Repository project milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

3 participants