Navigation Menu

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

Y-Axis in Evolution Graph #12122

Open
eramirezprotec opened this issue Sep 26, 2017 · 4 comments
Open

Y-Axis in Evolution Graph #12122

eramirezprotec opened this issue Sep 26, 2017 · 4 comments

Comments

@eramirezprotec
Copy link
Contributor

Hi! I’m trying to display an evolution graph with a metric created by me. The problem is that I want to show the metric’s range in a new Y-Axis. I can see that metrics like Bounce Rate, Avg. Visit Duration, Avg. Generation time, among others, make the graph to display a second Y-Axis. How can achieve this for my new metric? Right now I can make it work but using the normal Y-Axis.

Related issue: #3082

Thank you very much.

@sgiehl
Copy link
Member

sgiehl commented Sep 30, 2017

I guess you are using Report classes to build the reports? If so try to set $view->config->selectable_columns = [metric1, metric2] in configureView method. You then should be able to choose your metric for the evolution graph.

@eramirezprotec
Copy link
Contributor Author

Hi, @sgiehl. Thank you for your response.

Yes, I'm using Report class to build my report. And I'm also using the selectable_columns option but in an action of the controller related to the report. It looks like this:

$view = $this->getLastUnitGraphAcrossPlugins($this->pluginName, FUNCTION, $columns,
$selectableColumns, '', 'VisitsSummary.getMyMetrics');

Right now I'm able to select the metrics I want in the evolution graph.

It is all good until this point. My question is: let's suppose I have two metrics that I want the evolution graph to show: nb_visits and new_metric (metric made by me). How can I achieve that when I select both metrics at the same time, the nb_visits' range shows in the main Y-Axis and the new_metric's range shows in a second (the one on the right of the evolution graph) Y-Axis?

I'm attaching an image to help myself explaining better

Thank you in advance.

visits over time piwik

@sgiehl
Copy link
Member

sgiehl commented Oct 2, 2017

I think this only works if you are going to show different units. Currently the shown units are detected based on the column names (https://github.com/piwik/piwik/blob/3.x-dev/core/Metrics.php#L237-L252)
Guess we would need to extend that a bit in order to make it possible to show custom units for specific columns

@eramirezprotec
Copy link
Contributor Author

Hi, @sgiehl. Thank you very much. Your response helped me a lot! I agree with you, it would be nice to show custom units for specific columns.

Once again, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants