Skip to content

Chart y-axis numbers cut off in the PDF #13218

Closed

Description

@benbowler

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

Image

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 a K, M, B or T suffix 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 fit plotWidth on 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.
  • In assets/js/modules/search-console/components/dashboard/SearchFunnelWidgetGA4/getPDFData.ts:
    • Move the value axis styling from vAxis into vAxes[ 1 ], the axis the series actually render against, and add format: 'short' to it.
    • Add vAxes[ 0 ] with transparent gridlines and textPosition: 'none' so only one set of gridlines and labels draws.
    • Replace the fixed chartArea.right with the value returned by getValueAxisGutter.
    • Pass the horizontal axis the reduced list from pickDateTicks, using the chart width minus the gutter and the left inset as the plot width.
  • 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 vAxis and will fail until updated

QA Brief

  • With the trafficOverview flag 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 4K or 1.6M. Check that a smaller value shows its plain number, such as 500 or 0.12.
  • Check that the 0 at 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 trafficOverview flag off and download the report again. Check that the All visitors chart beside the donuts shows its value labels in full, and that its 0 doesn'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 as 58.000 for 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.

Activity

  1. self-assigned this
    on Jul 29, 2026
  2. removed their assignment
    on Aug 18, 2026
  3. self-assigned this
    on Aug 20, 2026
  4. zutigrm commented on Aug 20, 2026

    @zutigrm
    Collaborator

    AC & IB ✅

  5. removed their assignment
    on Aug 20, 2026
  6. self-assigned this
    on Aug 23, 2026
  7. removed their assignment
    on Sep 25, 2026
  8. removed their assignment
    on Sep 29, 2026
  9. assigned and unassigned on Sep 29, 2026
  10. self-assigned this
    on Oct 7, 2026
  11. kelvinballoo commented on Oct 7, 2026

    @kelvinballoo
    Collaborator

    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.

    • No numbers cut off: every value label on all line charts shows in full. None ends in an ellipsis.
    • Large numbers shortened: values of 1,000 or more end in a magnitude letter (e.g. 1K, 1.6K, 2.2K, 4K). Smaller values keep their plain number (e.g. 500, 800, 35).
    • 0 clear of the dates: the 0 at the bottom of each value axis sits clear of the date labels on every chart, including the wider decimal zeros on the AdSense charts (0,00 / 0,000).
    • Dates on one line: date labels stay on a single line at every range. The first label sits at the chart's left edge and the last at its right edge, with none cut off. Compared against the PDF report design.
    • Fewer dates on longer ranges: at longer ranges the labels skip days to fit (e.g. every 3rd day at 28 and 90 days on All visitors).
    • 14-day note: the half-width charts leave out the 2nd and second-to-last dates, and All visitors labels every day, as described.
    • trafficOverview flag off: I can't test this as it's no longer behind a feature flag.
    • German (Deutsch): dates use German month names (Sept. 9, Okt. 6) and stay on one line. Values use German formatting, shown in full with no ellipsis.
    • Consistency: all line charts behave the same way (All visitors, the 4 Search traffic charts and the 4 AdSense charts).

    Notes

    • On 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

  12. removed their assignment
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Low priorityTeam SIssues for Squad 1Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions