Repository navigation
Chart y-axis numbers cut off in the PDF #13218
Copy link
Copy link
Closed
Labels
P2Low priorityLow priorityTeam SIssues for Squad 1Issues for Squad 1Type: BugSomething isn't workingSomething isn't working
Description
Bug Description
The y-axis numbers on the search traffic chart cut off with an ellipsis. The column reads 5,500 then 5,0... then 4,500 then 4,0..., so every second number loses its digits. A reader can't tell whether 5,0... is 5,000 or 5,000,000. The bottom 0 also sits on top of the last date label. That happens on all five line charts.
The numbers should fit the column, and the 0 should clear the date row.
Steps to reproduce
Screenshots
Additional Context
- PHP Version:
- OS:
- Browser:
- Plugin Version:
- Device:
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Every value on a line chart's vertical axis is fully readable, with no number cut off by an ellipsis.
- Large values are shortened with a magnitude letter, so 58,000 reads as 58K, and the same applies to millions, billions and trillions.
- Values below one thousand keep their plain number, as they do today.
- The zero at the bottom of the vertical axis sits clear of the date labels below it.
- Date labels along the bottom stay on a single line, with fewer dates shown when the labels would otherwise crowd or wrap.
- All five line charts in the report behave the same way.
Implementation Brief
- In
assets/js/components/pdf-export/chart-axis.ts(new file):- Export
formatShortValue( value ), returning the value with aK,M,BorTsuffix above one thousand and a plain rounded number below it. - Export
getValueAxisGutter( maxValue, fontSize ), returning the pixel width the value labels need, measured from the widest of the maximum and its quarters. - Export
pickDateTicks( dates, plotWidth, fontSize ), returning every Nth date so the labels fitplotWidthon one line. - Estimate label widths from the character count and font size rather than a canvas measurement, which is unavailable in the offscreen container the charts render into.
- Export
- In
assets/js/modules/search-console/components/dashboard/SearchFunnelWidgetGA4/getPDFData.ts:- Move the value axis styling from
vAxisintovAxes[ 1 ], the axis the series actually render against, and addformat: 'short'to it. - Add
vAxes[ 0 ]with transparent gridlines andtextPosition: 'none'so only one set of gridlines and labels draws. - Replace the fixed
chartArea.rightwith the value returned bygetValueAxisGutter. - Pass the horizontal axis the reduced list from
pickDateTicks, using the chart width minus the gutter and the left inset as the plot width.
- Move the value axis styling from
- In
assets/js/modules/adsense/components/module/ModuleOverviewWidget/getPDFData.ts: apply the same four changes. - In
assets/js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/getPDFData.ts: apply the same four changes, at this chart's unscaled font size of 14.
Test Coverage
assets/js/components/pdf-export/chart-axis.test.ts(new file):- values below one thousand keep their plain number, and values above it take the matching magnitude letter through to trillions
- the gutter grows with the width of the widest label
- the date list thins as the plot narrows, and never returns fewer than two dates
assets/js/modules/search-console/components/dashboard/SearchFunnelWidgetGA4/getPDFData.test.ts, and the matching tests for the AdSense and Analytics charts:- the drawn options carry the styled
vAxes[ 1 ]with the short format - the reserved right gutter widens for data in the tens of thousands
- these three suites currently assert
vAxisand will fail until updated
- the drawn options carry the styled
QA Brief
- With the
trafficOverviewflag on, connect Search Console, Analytics 4, and AdSense to a site with data. Use a site with a chart whose values go above 1,000, so some value labels end in a letter. - Download the PDF report with the default 28-day range. Check that every value label to the right of each line chart shows in full, and none ends in an ellipsis.
- Check that a value of 1,000 or more ends in a letter, such as
4Kor1.6M. Check that a smaller value shows its plain number, such as500or0.12. - Check that the
0at the bottom of each value axis doesn't touch any date label. - Open the PDF report design beside the report. Check that on each line chart, the first date label starts at the chart's left edge, and the last one ends at its right edge.
- Set the dashboard's date range to Last 90 days and download the report again. Check that the date labels stay on one line and show fewer dates than at 28 days, with none cut off at either edge.
- Turn the
trafficOverviewflag off and download the report again. Check that the All visitors chart beside the donuts shows its value labels in full, and that its0doesn't touch any date label. - Set Settings > General > Site Language to Deutsch, keep your profile's Language on Site Default, and download the report again. Check that the date labels use German month names, such as
Sept. 23, and stay on one line. Check that every value label shows in full, such as58.000for 58,000, and none ends in an ellipsis.
Note: on a 14-day range, the half-width charts have no date label on the second and the second-to-last days. That leaves room for the first and last labels. The wide All visitors chart labels every day.
Changelog entry
- Fix cut-off and overlapping axis labels on the PDF report charts.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Low priorityLow priorityTeam SIssues for Squad 1Issues for Squad 1Type: BugSomething isn't workingSomething isn't working
Activity
zutigrm commentedon Aug 20, 2026
AC & IB ✅
kelvinballoo commentedon Oct 7, 2026
QA Update ✅
This was verified good
Tested on
develop, with Search Console, Analytics 4 and AdSense connected. PDF reports generated for the 7, 14, 28 and 90-day ranges, plus a German (Deutsch) 28-day report. PDFs attached.Notes
develop, the JavaScript text in the report doesn't translate because the language-pack file names don't match the dev build's hashed script names. For the German run I used a temporary mu-plugin to load the installed translation files.Details
site-kit-13218testkb-instawp-co-last-90-days-2026-10-07 (5).pdf
site-kit-13218testkb-instawp-co-last-28-days-2026-10-07 (3).pdf
site-kit-13218testkb-instawp-co-last-7-days-2026-10-07 - with Adsense.pdf
site-kit-13218testkb-instawp-co-last-14-days-2026-10-07 - with Adsense.pdf
site-kit-13218testkb-instawp-co-last-28-days-2026-10-07 - with Adsense.pdf
site-kit-13218testkb-instawp-co-last-90-days-2026-10-07 - with Adsense.pdf