Duplicate Dates on Graphs when 7 Days Selected
See original GitHub issueBug 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.hAxis
so 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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
Dates are made consecutive when you create charts in ...
When you chart a range of dates that are not consecutive, Microsoft Excel may fill in the missing dates to make the range...
Read more >Plot Two Time Series With Different Dates - Peltier Tech
Two time series can be plotted together, with one on the secondary axis, and the times will be kept independent. This approach is...
Read more >Duplicate dates on x axis - Stack Overflow
Any ideas what i'm missing? Edit: It's unrelated to this dataset and only happens because it's a large graph width and low amount...
Read more >Date Axis in Excel Chart is wrong - AuditExcel
You've built your chart, it all makes sense and suddenly you look at your horizontal axis, and the date axis is wrong. This...
Read more >Excel Graphing with Dates - YouTube
Fixing the X-axis to have the specific dates when you administered data on.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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