Skip to content

feat(charts): xKey, series labels, valueFormat and locale, stacks and horizontal bars (3.0) - #367

Merged
lorant-one merged 8 commits into
feat/3-0-breaking-cleanupfrom
feat/3-0-chart-props
Oct 30, 2026
Merged

lorant-one merged 8 commits into
feat/3-0-breaking-cleanupfrom
feat/3-0-chart-props

Conversation

@lorant-one

Copy link
Copy Markdown
Member

Requested by Lorant · project thread

Step 1 of the approved 3.0 chart plan (plan doc). This adds the chart props that stay the same when the renderer moves off recharts in beta.2. It is meant for 3.0.0-beta.1.

What changes

  • xKey names the column on the x axis. Before this, the chart guessed it.
  • Series label and format: the legend and tooltip show the label, not the raw key.
  • valueFormat ("compact", "percent", Intl.NumberFormatOptions or a function) and locale control how numbers are written on the value axis and in the tooltip. If neither is set, charts draw exactly as in 2.x. The value axis now widens to fit its longest label (for example 2 000 000 Ft).
  • stack (true or "percent") on LineChart and BarChart, and BarChart orientation="horizontal". In horizontal mode the category labels are sized to fit, and there is room for the legend.
  • C8 (break): date.onChange becomes date.onRangeChange. The codemod renames it when the date object is written inline, and reports it when the object is built elsewhere. There are no uses in this repo.
  • New CurveType and ValueFormat types. curveType is kept as a deprecated alias.
  • Fixes:
    • PieChart gradient ids are now scoped to each chart, so two pies on one page no longer share them.
    • With no series, the x column is no longer drawn as a series.
    • Axis ticks look up their row in a map instead of scanning all the data.

Docs: the LineChart page has new "Labels and numbers" and "Stacked" sections, BarChart has "Horizontal and stacked", and the setup and props tables are updated. MIGRATING, CHANGELOG and breaks.md (row C8) are updated too.

Checks

  • pnpm --filter @once-ui-system/core typecheck and the docs typecheck: clean.
  • Core vitest: 279 files and 3,909 tests pass, including the new chart-series-format.test.tsx.
  • pnpm test:codemod: 450 tests pass, including the new codemod-3.0-charts.test.mjs.
  • Biome on modules/data: same error count as the base branch.
  • Checked in the docs dev server in Chromium: the HUF currency axis and tooltip in hu-HU, the percent-stacked area chart, and the horizontal stacked bars.

Generated by Claude Code

… horizontal bars (3.0)

Step 1 of the 3.0 chart plan: the props the renderer swap keeps.

- xKey names the x column (guessed before); series take label and format.
- valueFormat (compact, percent, Intl options or a function) and locale
  write the value axis and tooltip; without them charts draw as 2.x did.
  The value axis widens to fit its longest label.
- stack (true or "percent") on LineChart and BarChart; BarChart
  orientation="horizontal", with category labels sized to fit.
- C8: date.onChange becomes date.onRangeChange; the codemod renames it in
  an inline date and reports one built elsewhere.
- CurveType and ValueFormat types; curveType stays as a deprecated alias.
- Fixes: PieChart gradient ids are scoped to each chart; with no series
  the x column is no longer drawn as a series; ticks find their row in a
  map instead of scanning the data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
@lorant-one lorant-one self-assigned this Oct 30, 2026
check-props lists inherited ChartProps rows on the mixin's table, so a
component page describing xKey, valueFormat or locale is reported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
The chart props now use CurveType (curveType stays as a deprecated
alias), so the regenerated spec resolves CurveType, not curveType.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq

Copy link
Copy Markdown
Member Author

The "Native preview and token export" check failed on f852640 because of one native test: test-native/mascotCube.test.tsx, "resolves the side presets into the faces' colors".

This failure isn't caused by this PR:

  • The PR changes no file under packages/native.
  • The test is a timing-based animation check (advance(3000), then it reads the face fills).
  • It passed 3 times out of 3 locally on this branch.
  • The same job passed on this PR's first push (6e81f12).

I'll re-run the failed job once when the workflow run finishes (it is still running). If it fails a second time, I'll treat that as a real failure and look into it.


Generated by Claude Code

…line up with the title

A top-left legend was inset a fixed 80px, the old 64px axis plus 16, so a
wider value axis (currency) or the category column of horizontal bars put
it over the axis labels. Legend takes the axis width. Horizontal bars'
category names start 20px in, where the title does, in one column.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq
A DatePicker with no value showed this month, read from the clock while
rendering. A page prerendered in one month and opened in the next drew a
different month on the server and in the browser, and hydration failed
(React #418). The docs check visits pages 25 hours after the build, so
every PR's Docs build fails from 30 October 23:00 UTC to the end of the
31st.

Without a date, Calendar and the range calendars start on a fixed month,
hidden, and move to this month in an effect.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq

Copy link
Copy Markdown
Member Author

The Docs build failure (React #418 on /form-controls/datePicker, four times) isn't caused by this PR. It happens on every PR into the 3.0 branch tonight, #371 included. The render check visits pages 25 hours after the build, which now falls in November, and a DatePicker with no value took its month from the clock while rendering. The fix is in #375. Once that merges, I'll merge the base into this branch so the check runs again.


Generated by Claude Code

@lorant-one
lorant-one merged commit 01074bb into feat/3-0-breaking-cleanup Oct 30, 2026
8 checks passed
lorant-one pushed a commit that referenced this pull request Oct 30, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq

# Conflicts:
#	CHANGELOG.md
#	packages/core/src/modules/data/interfaces.ts
lorant-one pushed a commit that referenced this pull request Oct 31, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtyZsWugGJ282wnC6vq

# Conflicts:
#	CHANGELOG.md
#	apps/docs/src/content/data/lineChart.mdx
#	packages/core/src/__tests__/legend.interaction.test.tsx
#	packages/core/src/modules/data/BarChart.impl.tsx
#	packages/core/src/modules/data/Legend.tsx
#	packages/core/src/modules/data/LineBarChart.impl.tsx
#	packages/core/src/modules/data/LineChart.impl.tsx
#	packages/core/src/modules/data/PieChart.impl.tsx
@lorant-one
lorant-one deleted the feat/3-0-chart-props branch October 31, 2026 21:34
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.

2 participants