Skip to content

Preserve explicit zero angles in polar area charts - #12364

Open
hakarrr wants to merge 2 commits into
chartjs:masterfrom
hakarrr:fix/polar-zero-angle
Open

hakarrr wants to merge 2 commits into
chartjs:masterfrom
hakarrr:fix/polar-zero-angle

Conversation

@hakarrr

@hakarrr hakarrr commented Oct 25, 2026

Copy link
Copy Markdown

Problem

Polar area arc angles currently use angle || defaultAngle, so an explicit angle of zero is replaced by the default sector size. This also affects scriptable and indexable angles. For example, [0, 180] renders two semicircles rather than a zero-angle first arc followed by one 180-degree arc.

Change

Only fall back for null or undefined angles, using the existing helper. Keep the existing hidden-element behavior and positive-angle behavior unchanged. This adds no option or API.

Seven regression/control cases cover literal zero, scriptable zero, mixed indexable and scriptable angles, positive angles, and null/undefined fallback. Four cases fail on unchanged master.

Validation

  • Polar-area controller suite: 75 passed.
  • Full ChromeHeadless suite: 1,710 passed in an isolated tree against master 71d44219.
  • ESLint for both changed files passed.
  • Rollup build and TypeScript declaration emit passed.
  • Before/after rendering was inspected with arc angles [0, 180].

Firefox and package-integration tests were not run. The adjacent types-only PR #12313 does not change this runtime fallback.

hakarrr and others added 2 commits October 26, 2026 04:51
Use null-or-undefined fallback for arc angles instead of replacing zero with the default sector size.

Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Cover literal and scriptable zero, mixed indexed and scriptable values, positive angles, and null/undefined fallback.

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