Closed wpdarren closed 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?
IB ✔️
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 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 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.
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.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
SearchConsoleStats
andAnalyticsStats
charts of theSearchFunnelWidget
should only show y values greater than or equal to zero (similar to all other charts used in the plugin)Implementation Brief
Within
assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/AnalyticsStats.js
:Determine whether the chart is composed of purely zero values:
isZeroChart
istrue
, setoptions.vAxis.viewWindow.max
to1
. The reference tooptions.vAxis.viewWindow
is static (it points toAnalyticsStats.chartOptions.vAxis.viewWindow
), so it should not be modified directly or the value will persist until the page is reloaded: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:
This can be seen by:
elasticpress.io
as your Search Console/Site Kit siteSo 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
Changelog entry