google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.25k stars 290 forks source link

Graph Y axis shows negative range in Search Funnel widget #4742

Closed wpdarren closed 2 years ago

wpdarren commented 2 years ago

Bug Description

On the Search traffic widget for Unified Dashboard displays a minus figure on the y-axis. This is an issue on main and entity dashboard. Note, that even if one field has zero data in the widget the same issue occurs.

image


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Within assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/AnalyticsStats.js:

Test Coverage

QA Brief

As part of doing development on this issue, I also noticed that a dashboard page with zero data for a Search Funnel page will show the negative Y axis:

CleanShot 2022-01-31 at 22 10 24

This can be seen by:

So this should also be QA'd by testing the above three steps and ensuring they don't show a negative Y axis, and instead show a min 0, max 1 Y axis:

Note: bounce rate should show a 0-100 y-axis range when the chart is empty since it is a percentage

CleanShot 2022-01-31 at 22 14 07

Changelog entry

aaemnnosttv commented 2 years ago

@wpdarren I see the issue regarding the negative range on the chart, however I don't see the limited range on the x axis – I think this may be specific to the site. How old is this site?

eugene-manuilov commented 2 years ago

IB ✔️

tofumatt commented 2 years ago

Hmm, just an update that this is a bit weirder than we thought because different stats with zeros are behaving a bit oddly… I'm still working on it, but it's a bit trickier than the ACs/IB states because ALL stats have this issue when they're zero, but we can't check for zero state; we need to check each stat for zero values…

techanvil commented 2 years ago

QA :white_check_mark:

aaemnnosttv commented 2 years ago

@techanvil one other detail worth checking is that when the value is non-zero (current or previous period), the max y-axis of the chart should be set as usual (based on the data in the set) but always with a min y-axis of 0.

techanvil commented 2 years ago

@techanvil one other detail worth checking is that when the value is non-zero (current or previous period), the max y-axis of the chart should be set as usual (based on the data in the set) but always with a min y-axis of 0.

Thanks for pointing that out, @aaemnnosttv - I've gone and verified :white_check_mark: that the Y axis starts at 0 for all of the Search Funnel charts when there is data for the chart, and the X axis is correctly defined too.