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

Default number of dates for periods in evolution graphs appear to be wrong. #6044

Closed
mvalle opened this issue Aug 21, 2014 · 1 comment
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc. worksforme The issue cannot be reproduced and things work as intended.

Comments

@mvalle
Copy link

mvalle commented Aug 21, 2014

I've been debugging some odd behaviour in my plugin, and I found what appears to be a strage default values for ranges used in Evolution graphs.

It is possible that there is a valid reason for these numbers, but surely the default number of dates for a "week" range is 7, not 26.

Trying to find the origin of this, I tracked it back to this commit from 2012 before I gave up.
Below is where it is today.

File: piwik/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php

/**
* Returns the default last N number of dates to display for a given period.
*
* @param string $period 'day', 'week', 'month' or 'year'
* @return int
*/
public static function getDefaultLastN($period)
{
    switch ($period) {
        case 'week':
            return 26;
        case 'month':
            return 24;
        case 'year':
            return 5;
        case 'day':
        default:
            return 30;
    }
}
@mattab
Copy link
Member

mattab commented Aug 23, 2014

Thanks for report. This is not a bug, this "default last N" means the number of "weeks" that we will display on an evolution graph. It's a bit confusing but when you look at WEEK in Piwik, it will show you the last WEEKS in the calendar, where you may have expected to see the DAYS within the selected week. See this enhancement issue and feel free to discuss it there #955

@mattab mattab closed this as completed Aug 23, 2014
@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Sep 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

2 participants