site-kit-wp: Duplicate Dates on Graphs when 7 Days Selected
Bug Description
While testing #3517 I noticed that the dates on the x-axis were duplicated when 7 days was selected. After further investigation it appears that this issue appears on all graphs, i.e. on AdSense, Analytics, etc.

Steps to reproduce
- Make sure you are on the develop branch
- Go to a Module page, i.e. Analytics
- Select 7 days
- Scroll down to the graph and observe the dates
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- In any of the chronological charts on the per-module pages (Search Console, AdSense, Analytics) it should never happen that a single date is displayed multiple times as label for the x-axis.
- This is particularly relevant for the “last 7 days” filter, in which right now it usually causes several dates to display more than once.
Implementation Brief
In assets/js/modules/analytics/components/module/ModuleOverviewWidget/SiteStats.js
- Create an array of only Date objects from
dataMap - Add this to the options object for the key
hAxis.ticks(Make sure to spread in...SiteStats.options.hAxisso as not to override any existing options)
(Work done on branch here https://github.com/google/site-kit-wp/tree/bug/3643-Duplicate-Dates-Graphs-7-Days__idea-1)
Test Coverage
- N/A
Visual Regression Changes
- N/A
QA Brief
For each of the chronological charts on the per-module pages (Search Console, AdSense, Analytics)
- View with the “last 7 days” filter,
- Observe that no dates are repeated on the x-axis (see the original problem on the screenshot in ticket description)
Changelog entry
- Update stats graphs not to duplicate dates when 7 days period is selected.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (9 by maintainers)
@danielgent those are the only places I noticed the duplicate dates, when 7 days was selected.
Just a headsup that my changes have caused some VRT regressions.
Upon looking at the differences, I don’t think it’s actually an improvement
before and after
another before and after
I could restrict my changes to only take effect when the user has selected Last 7 days
@eugene-manuilov I’ve just realized that @wpdarren mentioned several modules in the description, but my IB is only for the analytics module
Not a huge problem, I’ll see if I can do anything clever to not duplicate code, and then I’ll assign the CR to you 👍