Skip to content

Avoid boundary clipping for shape fills with color options - #12368

Open
hakarrr wants to merge 2 commits into
chartjs:masterfrom
hakarrr:fix/shape-fill-color-crash
Open

hakarrr wants to merge 2 commits into
chartjs:masterfrom
hakarrr:fix/shape-fill-color-crash

Conversation

@hakarrr

@hakarrr hakarrr commented Oct 26, 2026

Copy link
Copy Markdown

Problem

A Cartesian line or scatter chart throws during creation with fill: {target: 'shape', above: 'red', below: 'blue'}. Shape mode resolves its target to true, but the differing-color path tries to clip against that target's segments as if it were a line.

Change

Skip boundary-color clipping for the shape sentinel. Shape mode has no target boundary to compare against. It keeps the existing single-color behavior using below, including the fallback to the dataset background color, rather than adding a new two-color shape interpretation.

Actual line targets and scale boundaries still use the existing above/below clipping.

Verification

  • 18 added cases: line and scatter with both index axes across all three filler draw timings, radar controls, and origin/start/end controls.
  • Pristine source: the 12 Cartesian shape cases throw. With the guard: all cases render, including repeated updates; center pixels are the expected opaque blue.
  • Fresh frozen-lockfile dependency install, full native Karma/ChromeHeadless suite: 1721/1721 pass.
  • pnpm build, including declaration generation, and tsc --noEmit: pass.
  • Changed-file ESLint: pass without warnings.
  • Inspected actual before/after canvases: baseline throws and leaves a blank chart; fixed renders the enclosed square.

Firefox and downstream integration suites were not run.

hakarrr and others added 2 commits October 26, 2026 20:04
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