Skip to content

Use horizontal scale edges for start and end fills - #12373

Open
hakarrr wants to merge 2 commits into
chartjs:masterfrom
hakarrr:fix-horizontal-fill-boundaries
Open

hakarrr wants to merge 2 commits into
chartjs:masterfrom
hakarrr:fix-horizontal-fill-boundaries

Conversation

@hakarrr

@hakarrr hakarrr commented Oct 26, 2026

Copy link
Copy Markdown

Problem

For a line chart with indexAxis: 'y', fill: 'start' and fill: 'end' use the value scale's bottom and top coordinates as horizontal positions. Those are Y coordinates, so the fill can end inside the chart, on the wrong side of the line, or outside the chart depending on the canvas dimensions and padding.

Change

Use scale.left/scale.right for horizontal value scales and retain scale.bottom/scale.top for vertical ones. This keeps start/end as geometric scale boundaries, including reversed scales. Origin and explicit-value targets are unchanged. Radial boundaries and above/below color clipping are not changed.

Tests

Added 32 native canvas cases: start/end boundaries on both index axes, reversed scales, all three filler draw timings, repeated updates, plus origin and explicit-value controls. Asymmetric layout padding ensures a Y coordinate cannot accidentally look like the correct X edge. Pixel assertions check both the filled and empty sides.

Against unmodified master, 12 horizontal boundary cases fail and 20 controls pass. With the fix, a fresh frozen-lockfile install passes all 1735 Karma/Chromium cases, the production build, declaration generation, tsc --noEmit, and scoped ESLint with no warnings or errors. Firefox and downstream integration tests were not run locally.

This is separate from #12058's above/below colors and #12363's stacked target interpolation: it only changes the coordinate selected for start/end boundary targets.

hakarrr and others added 2 commits October 26, 2026 22:28
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant