question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate Dates on Graphs when 7 Days Selected

See original GitHub issue

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.

dates

Steps to reproduce

  1. Make sure you are on the develop branch
  2. Go to a Module page, i.e. Analytics
  3. Select 7 days
  4. 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:closed
  • Created 2 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
wpdarrencommented, Jul 20, 2021

@wpdarren I see this bug on the AdSense, Analytics, and Search Console pages. Is there anywhere else you spotted?

@danielgent those are the only places I noticed the duplicate dates, when 7 days was selected.

1reaction
danielgentcommented, Jul 19, 2021

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

before-A

after-A

another before and after

before-B

after-B

I could restrict my changes to only take effect when the user has selected Last 7 days

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found