Opened 3 years ago

Closed 19 months ago

Last modified 17 months ago

#2159 closed New feature (fixed)

Add a Select list in the graph footer, to select periods to plot: 30, 100, 365

Reported by: matt Owned by: capedfuzz
Priority: critical Milestone: 1.9 -- Piwik 1.9
Component: UI - UX (AngularJS, twig, less) Keywords:
Cc: Sensitive: no

Description

It would be nice to view in the graph, the number of visits for the last 300 days for example. Currently the graphs only show last 30 days / weeks / months / years.

All pages supporting sparklines + graph (overview type pages) would benefit from this new feature, as well as widgets in the dashboard.

This could be implemented as a Select list / legend next to the icons.

This is similar to the ticket "add a select list to choose which column to plot" in #1820

Attachments (1)

2159.diff.tar.gz (5.7 KB) - added by capedfuzz 19 months ago.
Patch for this issue.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 3 years ago by matt (mattab)

  • Component changed from Core to UI (templates, javascript)

comment:2 Changed 3 years ago by matt (mattab)

  • Summary changed from Add Overview last visits graph Select to set 30, 100, all to Add a Select list in the graph footer, to select periods to plot: 30, 100, 365

comment:3 Changed 23 months ago by matt (mattab)

  • Milestone changed from 1.x - Piwik 1.x to 1.8.x - Piwik 1.8.x

Nice we could now reuse the new UI element (to select number of rows) that would, when an evolution graph is displayed, change the number of days/weeks/months plotted on the graph from the default 30. That would be beautiful!!

comment:4 Changed 22 months ago by matt (mattab)

  • Priority changed from normal to critical

comment:5 Changed 21 months ago by matt (mattab)

  • Owner set to capedfuzz

comment:6 Changed 20 months ago by matt (mattab)

  • Milestone changed from 1.8.x - Piwik 1.8.x to 1.8.4 - Piwik 1.8.4

This will be awesome in the widgets on dashboard, in all evolution graphs in reports (including Row Evolution!)

Changed 19 months ago by capedfuzz (diosmosis)

Patch for this issue.

comment:7 Changed 19 months ago by capedfuzz (diosmosis)

I've uploaded a patch for this issue. Let me know what you think of it.

Some notes:

  • This reuses the filter_limit dropdown.
  • There are several other bug fixes in here.

comment:8 Changed 19 months ago by capedfuzz (diosmosis)

  • Resolution set to fixed
  • Status changed from new to closed

(In [7068]) Fixes #2159, allow limit dropdown to be used with evolution graphs (including row evolution).

Notes:

  • Bug fix for RowEvolution.php: length of evolution was one date too long.
  • Added new query parameters: evolution_{$period}_last_n
  • Bug fix for ViewDataTable::setColumnsToDisplay, column array should be filtered before being set.
  • Removed default value for idGoal parameter for AddColumnsProcessedMetricsGoal filter.
  • Bug fix for Period/Range.php: lastN should be decremented AFTER it is checked for the max value.
  • Bug fix for Period/Range.php (in fillArraySubPeriods): fix issue when determining subperiods for range of weeks.

comment:9 Changed 19 months ago by matt (mattab)

(In [7070]) Refs #2159 fixing notice

comment:10 Changed 19 months ago by matt (mattab)

Very nice new little feature & commit, kuddos Benaka!

PS: I am still curious as to why the smarty notices don't display in your server, hopefully we find the solution in the future as to prevent these NOTICEs!

comment:11 follow-up: Changed 19 months ago by matt (mattab)

Questions:

  • when is the following code path triggered?
    if (Piwik_Period_Range::parseDateRange($this->originalDate)) // if a multiple period 
    

My understanding was that in the UI we would not work on multiple periods ?

comment:12 Changed 19 months ago by matt (mattab)

(In [7075]) Refs #2159

  • Fixing RowEvolution popover click on selector: Warning:</strong> <i>array_keys() expects parameter 1 to be array, null given</i>
  • Changing default monthly to show 2 years history
  • Simplifying code of getXAxisStepSize() since it seemed too complicated ;)
  • removing incorrect title which was always "Showing evolution over last 30 $period"

comment:13 in reply to: ↑ 11 Changed 19 months ago by capedfuzz (diosmosis)

Replying to matt:

Questions:

  • when is the following code path triggered?
    if (Piwik_Period_Range::parseDateRange($this->originalDate)) // if a multiple period 
    

My understanding was that in the UI we would not work on multiple periods ?

It's a sanity check to cover the case if multiple dates are passed instead of a single date + evolution_{$period}_last_n.

comment:14 Changed 17 months ago by matt (mattab)

(In [7425]) fixes regression: exporting below the graph should export all periods displayed in the graph (using the rewritten &date=)
refs #2159

Note: See TracTickets for help on using tickets.