Skip to content

[player-coachhelm][mobile] Putting make-rate chart: x-axis labels collide and y-axis labels clip off-screen #968

Description

@njrini99-code

Where

Player-facing golf surface, mobile (390px). The putting make-rate by distance line chart (green solid = you, grey dashed = PGA/reference; distance bands 0-3 / 3-5 / 5-10 / 10-15 / 15-25 / 25+ ft). Likely component: a putting make-rate line chart rendered in src/components/fairway/pages/coachhelm/FairwayStatsCockpit.tsx or the CoachHelm shot-analysis deep dive — confirm the exact chart at fix time (grep the "0-3 ft" band labels).

Evidence

IMG_4975. This is the "text isn't rendering for the chart" report.

The problem

  1. X-axis category labels overlap/collide. They render as 0-3 ft 3-5 ft 5-10 f10-15 ft15-25 f25+ ft — adjacent labels run into each other because six ~6-char labels do not fit the 390px plot width at the current font size and there is no rotation / abbreviation / wrapping / interval strategy.
  2. Y-axis tick labels are clipped at the left edge. Only a partial "0" is visible; the numbers are cut off by the chart's left margin / the page gutter. The plot has no left margin reserved for the axis, or the chart overflows its container to the left.
  3. The plot overflows its container — the green line runs off the left edge, confirming the chart is wider than its box and is being clipped rather than fit-to-width.

How it should look (architecture)

  • The chart must fit within its card on a 390px viewport: reserve an explicit left margin for y-axis labels, and never let the plot area exceed the card's content box (the card, not the chart, owns horizontal bounds; if anything scrolls, it's an inner overflow-x:auto container, never the page body).
  • Six dense x labels on mobile need a real strategy: rotate ~-35°, OR abbreviate (0-3, 3-5, … dropping the repeated "ft" into the axis title), OR thin to every other tick with the rest on tap. Pick one and apply it responsively (full labels on desktop, condensed on mobile).
  • Value callouts (61%, 35%, …) must not sit on top of gridlines/other labels.

Acceptance criteria

  • At 390px, every x-axis label is fully readable with no character overlap between adjacent labels.
  • Y-axis tick labels are fully visible (not clipped by the left edge).
  • The chart's drawn area stays inside its card; page body does not scroll horizontally.
  • Verified against prod with a real player (rinin376) via the headless capture harness at audit/product-audit/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    plan-meTrigger CodeRabbit automatic issue planning

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions