Skip to content

docs: design isolated category scale labels - #12434

Merged
kurkle merged 2 commits into
chartjs:masterfrom
kurkle:design/isolate-category-scale-labels
Nov 23, 2026
Merged

kurkle merged 2 commits into
chartjs:masterfrom
kurkle:design/isolate-category-scale-labels

Conversation

@kurkle

@kurkle kurkle commented Nov 23, 2026

Copy link
Copy Markdown
Member

The category scale collects the labels it finds in the data by pushing them into the user's data.labels, which every category axis shares. It also resolves bounds given as labels before the data is parsed, and it accepts only strings as labels. Together these cause four open issues. This pull request is the design for fixing them, written as the OpenSpec change openspec/changes/isolate-category-scale-labels/. It adds no code.

Pieces, in merge order

  1. P1: bounds are resolved after the data. This is fix: keep inferred category labels in data order with string bounds #12431 as it stands, rebased onto master. It needs one beforeLayout() that parses all four bounds, and a spec that pins the suggestedMin/suggestedMax re-parse. Completes Category scale: string min and max reorder the labels when the labels come from the data #12430.
  2. P2: scatter and bubble tooltips take the category label from their category axis, the index axis first, then the value axis. This keeps master releasable once P3 lands. Part of Category scale infers labels from data plotted on other scales #11495 and Array passed as labels option is modified by Chart.js #11893.
  3. P3: each category axis owns a copy of its labels, built on fix(category): do not modify the user provided labels array #12344's code, with Co-authored-by credit to the authors of fix(category): do not modify the user provided labels array #12344 and Fix category scales inferring labels from other scales #12405. It removes _addedLabels and P1's lookup-only flag, and takes Fix category scales inferring labels from other scales #12405's isolation specs and the stacked case of fix(bar): positioning and category isolation for bar charts with stacked axes #12222. Completes Category scale infers labels from data plotted on other scales #11495 and Array passed as labels option is modified by Chart.js #11893.
  4. P4: multi-line (array) labels in object data. Completes Parsing data object does not allow for Array Label #12065.

Parallel and waiting

Part of #11495, part of #11893, part of #12430, part of #12065.

@netlify

netlify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for chartjs-docs canceled.

Name Link
🔨 Latest commit 7523aca
🔍 Latest deploy log https://app.netlify.com/projects/chartjs-docs/deploys/6b048a6cad494dd225dd8dfd

@kurkle
kurkle marked this pull request as ready for review November 23, 2026 18:48
@github-actions

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 361 kB

ℹ️ View Unchanged
Filename Size
dist/chart.cjs 81.4 kB
dist/chart.js 81.7 kB
dist/chart.umd.js 72.1 kB
dist/chart.umd.min.js 72.1 kB
dist/chunks/helpers.dataset.cjs 25.7 kB
dist/chunks/helpers.dataset.js 25.5 kB
dist/helpers.cjs 1.52 kB
dist/helpers.js 1.33 kB

compressed-size-action

@kurkle
kurkle merged commit 621ec55 into chartjs:master Nov 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants