Skip to content

fix(plugin-report): a report chart's value axis reads a percent measure in percent, and two value-axis ticks never share a label - #37051

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-36988-report-chart-axis-format
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-36988-report-chart-axis-format

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #36988
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:报表里的图表画百分比指标时,纵轴刻度从「0、0.1、0.2、0.3、0.3」变成「0.0%、8.5%、17.0%、25.5%、34.0%」;任何图表的纵轴都不再出现两个相同的刻度。
  • 为什么做:修复 HotCRM 服务应用里「SLA 表现」报表的读数问题——表格写着 33.3%,旁边的图表却显示小数,还有两个重复的刻度。
  • 出错会怎样:最坏是某张图表的纵轴刻度比以前多显示一两位小数,数值本身不变;撤回这次改动即可恢复原样。
  • 要你做什么:无。货币指标和「已按百分点存储」的百分比指标的纵轴怎么显示,已另立 Report and dashboard chart value axis: show a whole-scale percent and a currency measure in the format the table gives them #37053 处理,不在本 PR。

What changes

Two defects on one axis, filed together on the card:

  1. The report chart is handed its measure's percent pattern. DatasetReportRenderer built the chart schema with no value-axis format, so a '0.0%' measure plotted raw fractions beside a table printing 33.3%. It now passes the pattern on the chart's existing value-axis key, yAxis: [{ format }] (the spec ChartAxis shape normalizeChartSchema already reads; no new key). percentAxisFormat passes it only where the chart's reading of the pattern (formatterFor: a % pattern is a 0-1 fraction printed x100) is the table's (formatMeasure at the fraction scale, which is also its reading of an unannotated column). It does not pass it for:
    • percentScale: 'whole': the axis would multiply percentage points by 100 a second time;
    • a declared currency or a per-row currencyField: the table prints the currency, and the axis pattern has no ISO-code slot;
    • a pattern carrying a currency symbol, which the two readers place differently;
    • a plain numeral pattern: a fixed-width pattern ('0,0.00' gives 1,200,000.00) would outgrow the 48 px axis band, and the compact default reads the same number.
  2. Two value-axis ticks never share a label. valueTickExponent (plugin-charts, normalizeChartSchema.ts) works out the decimal place an axis' tick step needs: recharts' nice step is never below span / (tickCount - 1) and carries at most two significant digits, so the place one below that bound's leading digit prints every nice step exactly, and two ticks at least one step apart cannot round onto one label. The span is the one ticksFor already uses (declared min/max, else the plotted values with zero), and the tick count is the one yAxisSpecProps hands recharts. A log axis gets no exponent and keeps the old rule.
    • The compact fallback (compactTickFormatter) rounds each value to that place, spelled as significant digits so the compact unit (K/M, or 万/亿 in zh) never changes which place is kept, with the old one-fraction-digit reading as a floor (roundingPriority: 'morePrecision'). So 0, 0.1, 0.2, 0.3, 0.3 becomes 0, 0.085, 0.17, 0.255, 0.34.
    • A declared format keeps its own places as the minimum and gains places only when they are too coarse for the step ('0%' over a 0.85-point step prints 0.85% instead of two 3% ticks).
    • The left, right and sole value axes each get their own exponent. Data labels keep using their axis' formatter (objectstack#27372), so they print at the axis' place too.

Tests

  • ui/packages/plugin-charts/src/AdvancedChartImpl.axisLabels.test.tsx, a new top-level describe in the axis-tick harness, with the card's data (one bucket at 1/3, the rest 0):
    • no format: ticks ['0', '0.085', '0.17', '0.255', '0.34'], all distinct (red on the pre-fix tree: 4 distinct of 5);
    • yAxis: [{ format: '0.0%' }], the schema the report hands over, run through normalizeChartSchema: ['0.0%', '8.5%', '17.0%', '25.5%', '34.0%'];
    • '0%' over a tenth of the rate: ['0%', '0.85%', '1.7%', '2.55%', '3.4%'] (red on the pre-fix tree: two 3%).
  • ui/packages/plugin-report/src/__tests__/DatasetReportRenderer.chartChrome.test.tsx, a new top-level describe: the filed report hands the chart yAxis: [{ format: '0.0%' }] while the table beside it prints 33.3% (red on the pre-fix tree: the key is absent). Controls for percentScale: 'whole', currency: 'CNY' and '0,0.00' assert that no yAxis is handed over.
  • The report-path pin stops at the schema the registered chart component receives. plugin-report does not depend on plugin-charts, and a dev dependency would be a package.json edit outside this card's file surface. The drawn half is the plugin-charts pin on the same schema, the split DatasetReportRenderer.chartLocaleChrome-9038.test.tsx already uses.

Acceptance notes

  • Left for a decision (the other half of the card's (1)): the chart's axis format key cannot express a currency (ISO code or per-row) or a percent already in percentage points. Those measures keep the default axis, which now shows distinct ticks but no currency symbol or percent sign. The options are in the report to the seat.
  • Not measured: a dashboard chart widget over the same measure (the card did not measure it either). DatasetWidget passes no axis format, so (2) reaches it and (1) does not.
  • formatterFor's percent arm prints with Intl style: 'percent', while formatMeasure uses percentPoints. For the passed case (two places or fewer, fraction scale) they produce the same affix and digits.

Verification

Two-minute check: cd ui && pnpm --filter @object-ui/plugin-charts exec vitest run --root ../.. packages/plugin-charts/src/AdvancedChartImpl.axisLabels.test.tsx packages/plugin-report/src/__tests__/DatasetReportRenderer.chartChrome.test.tsx. Expect 28 passed, including the four objectstack#36988 cases in the axis file.

Read first, in order of risk:

  1. ui/packages/plugin-charts/src/normalizeChartSchema.ts: valueTickExponent (the step lower bound) and compactTickFormatter (the significant-digit rounding and its floor).
  2. ui/packages/plugin-charts/src/AdvancedChartImpl.tsx: valueAxisTickFormatter, which replaced formatYTick. slotSeries/axisValues moved above it unchanged.
  3. ui/packages/plugin-report/src/DatasetReportRenderer.tsx: percentAxisFormat and the yAxis entry in the chart schema.
Package suites and type-check at 6360f0c (the final head, after merging origin/main)
  • pnpm --filter @object-ui/plugin-charts exec vitest run --root ../.. --maxWorkers=2 packages/plugin-charts/ packages/plugin-report/: Test Files 141 passed (141), Tests 1738 passed, 16 skipped. Lock line: VERDICT command-exit 0.
  • pnpm --filter @object-ui/plugin-charts run type-check && pnpm --filter @object-ui/plugin-report run type-check (both tsc --noEmit && tsc -p tsconfig.test.json): VERDICT command-exit 0.
Red before, green after: one ablation per fix

Each ablation put the fix's source files back to their pre-fix blobs, checked the hashes on disk, ran both pin files, then restored from HEAD and checked git diff HEAD was empty.

  • Report fix (DatasetReportRenderer.tsx at blob 8c855882): 1 failed, 27 passed. The failure was "hands the chart the measure's percent pattern …". The three no-yAxis controls stayed green, as they should, because they guard against passing the format too widely. All chart pins stayed green.
  • Chart fix (AdvancedChartImpl.tsx at a20c9981, normalizeChartSchema.ts at fef8d89b): 2 failed, 26 passed. The failures were the no-format case (4 distinct labels of 5) and the '0%' case. The '0.0%' case stayed green, because that pattern already resolves a 0.085 step on its own; the report ablation covers its red side.
Derived gate families (dispatch-gates --commands, 40 families, tree 6360f0c)

All 40 exited 0, with the exit code captured before any pipe. pnpm --dir ui exec vitest run scripts/ (run with --maxWorkers=2) reported Test Files 172 passed, 2 skipped, and Tests 5129 passed. dispatch-gates --ran: 40 derived, 40 run, 0 NOT-MEASURED, 0 UNRUN. The CI-owned families are cited from this PR's check-runs.


Generated by Claude Code

Seat note: the remaining axis formats (a whole-scale percent and a currency measure) moved to their own card, #37053 (route B of the open question); the first line of this body is the fix of record for the filed case.

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 24, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head ecddad22b6856e0f92409d10425ebc9a39275987 · 2026-11-24T19:59Z

Card #36988.

  • Shape. 6 files (+344/−37) in ui/packages/plugin-charts/src/ and ui/packages/plugin-report/src/, plus one changeset (patch, Clause-②: no, Metadata-protocol: none). Not governed; no contract face: the report hands the chart the existing spec ChartAxis key yAxis: [{ format }], which normalizeChartSchema already reads — no new key.
  • Fix (1), read against the code. percentAxisFormat passes a measure's pattern only when it carries %, no currency symbol, no percentScale: 'whole', no declared currency and no per-row currencyField — exactly the cases where formatterFor's percent reading (0–1 fraction ×100) equals the table's formatMeasure at the fraction scale. It is spread before ...chrome, so an author's own axis config still wins.
  • Fix (2), read against the code. valueTickExponent derives the tick place from the lower bound of recharts' nice step (span / (tickCount − 1), declared stepSize taken as is; log axis → none), one place below its leading digit; compactTickFormatter rounds to it as significant digits with the old one-fraction reading as floor (roundingPriority: 'morePrecision'), and formatterFor widens a declared pattern's max places only when too coarse for the step (capped at 20). Each value axis gets its own exponent. Two ticks at least one step apart therefore cannot print the same label.
  • Tests. The card's data through the real axis harness: no-format, '0.0%' and '0%' cases; the report hands yAxis: [{ format: '0.0%' }], with controls for whole, CNY and '0,0.00'. One ablation per fix turns its own pins red; restored clean.
  • Open half routed: whole-scale percent and currency measures on the axis moved to card Report and dashboard chart value axis: show a whole-scale percent and a currency measure in the format the table gives them #37053 (route B); the PR body's 速读 is corrected to say so (no ask of the maintainer here).
  • Gates. Head ecddad22b6 is a merge of main (254e396a29) into the reviewed 6360f0c83f; its tree equals the automatic merge tree, so no file of the PR moved. Check-runs at this head: 40 success, 13 expected skip, 0 failed, 0 pending. Landing K: 3 first-parent commits on main since the merge base.
  • No must-fix, no should-fix.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 24, 2026 19:59
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 293c005 Nov 24, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36988-report-chart-axis-format branch November 24, 2026 20:19
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…d fields (objectstack-ai#37125)

Fixes objectstack-ai#37033

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
用户在报表的交叉矩阵里点开某个数字后,弹出的记录列表除了标题,还会默认显示该格对应的行分组、列分组和被汇总的字段(例如状态、优先级、预计工时);之前只显示标题。
- 属于「仪表盘与报表」史诗,让矩阵下钻与汇总报表、仪表盘透视表的下钻表现一致。
- 若出错,用户只会看到下钻列表的默认列不对,记录本身和筛选条件不变;可直接撤回此改动。
- 无

## What changes

A report matrix cell's drill now goes through the same builder a summary
line and a chart mark already use (`emitBucketDrill` in
`DatasetReportRenderer.tsx`), so its `DatasetDrillArgs` carries
`fields`: the down dimension's field, the across dimension's field and
the measured field, in that order. The host (`ReportView`) already hands
`fields` to the drill list as `defaultColumns`, so it is untouched.

The matrix drill used to be a hand copy of that builder without the
`fields` line; the copy is removed, not patched, so there is one
derivation. The filter is unchanged: the relationship-path branch, the
refusal branch and the no-object fallback are the same code the summary
line runs, and a drill still lists exactly the records its measure
counted.

Read first (by risk):
1. `ui/packages/plugin-report/src/DatasetReportRenderer.tsx`, the
`drillCell` hunk in the matrix renderer: confirm the removed branches
are byte-equivalent to `emitBucketDrill`'s (same `rawRow`, `rowRanges`,
`scope`, refusal and fallback).
2.
`ui/packages/plugin-report/src/__tests__/DatasetReportRenderer.chartMarkDrill-36256.test.tsx`,
the new top-level `describe`.

Two-minute check: `cd ui && pnpm exec vitest run
packages/plugin-report/src/__tests__/DatasetReportRenderer.chartMarkDrill-36256.test.tsx`
shows 5 passed; on `main` the matrix case fails with `expected undefined
to deeply equal [ 'status', 'priority', … ]`.

## Tests

- New: a matrix cell drill emits `fields` equal to `['status',
'priority', 'estimate_hours']` (the card's case), and its object filter
still carries the measure's `estimate_hours` scope and the clicked
bucket.
- Control: a summary line drill keeps `['stage', 'amount']`.
- Reverse verification (fix committed first): with
`DatasetReportRenderer.tsx` restored from the base `ebb4713c0`, the
matrix test fails (`AssertionError: expected undefined to deeply equal [
'status', 'priority', …(1) ]`, 1 failed / 4 passed); restored with `git
checkout HEAD`, `git diff HEAD` empty and the blob hash matches HEAD.

## Acceptance notes

- Browser check (`/report/showcase_status_priority_matrix`, drill 待办 /
中): NOT MEASURED, reason: the dev server needs a full workspace and
Console build that this run did not do. The host path was read instead:
`ReportView` `handleDatasetDrill` stores `fields` and passes it to the
drill list as `defaultColumns`, the same path the summary-row drill
already uses.

## Verification

<details><summary>Local runs on head (see report for the sha)</summary>

- `pnpm --filter @object-ui/plugin-report test`: Test Files 38 passed
(38), Tests 379 passed, 7 skipped (386).
- `pnpm --filter @object-ui/plugin-report type-check`: exit 0.
- `node scripts/pm/overlap-check.mjs`: VERDICT clean exit 0 against
`origin/main` and objectstack-ai#37051.
- Derived gate families (`dispatch-gates --commands`): run locally,
results in the report; every other family is CI's.

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… whole-scale percent and a currency measure in the measure's units (objectstack-ai#37194)

Fixes objectstack-ai#37053
Clause-②: yes
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:报表和仪表盘里的图表,纵轴刻度现在带上指标自己的单位——按百分点存储的百分比指标从「0、9、18、27、36」变成「0.0%、9.0%、18.0%、27.0%、36.0%」,人民币金额指标从「3K、6K」变成「CN¥3K、CN¥6K」(中文界面写作「¥30万」这样的形式);仪表盘组件画按小数存储的百分比指标时,纵轴原来没有百分号(组件不传纵轴格式),现在读作「0.0%…34.0%」,与旁边表格的读法一致。
- 为什么做:接续上一张修复报表图表百分比纵轴的卡,补齐它当时留下的另一半(按百分点存储的百分比和货币金额)。HotCRM「SLA
表现」报表的违约率是按小数存储的百分比,它的报表纵轴上一张卡已修好,本次不变;变化的只是画同一指标的仪表盘组件。
-
出错会怎样:最坏是某张图表的纵轴单位或小数位显示得不如预期,数值和图形本身不变;每行币种不同的金额指标仍显示纯数字;撤回这次改动即可恢复原样。
- 要你做什么:无。

## What changes

Route **B** of the card, as the seat chose it: an internal value-format
carrier beside the internal series props. No spec change. The report and
dashboard producers fill the carrier; it is not meant to be authored,
and objectstack-ai#37214 refuses it on static chart nodes.

1. **The carrier.** `series[].measureFormat` carries the measure's `{
format, currency, percentScale }`. It sits on the chart renderer's
internal series props, beside `series[].aggregate`, and follows that
key's precedent: the report and dashboard producers fill it from the
dataset answer, and it is not meant to be authored (objectstack-ai#37214 refuses it on
static chart nodes). Three places hold it:
- `MeasureValueFormat` and `NormalizedSeries.measureFormat` in
`normalizeChartSchema.ts`;
- `normalizeSeries`, which keeps the carrier's three keys and nothing
else;
   - the internal `dataKey` arm of `ChartRendererProps.schema.series`.
2. **The value axis reads it** at the tick-step place PR objectstack-ai#37051
introduced (`valueAxisTickFormatter` in `AdvancedChartImpl.tsx`). The
order is a declared axis `format` first (`formatterFor`, unchanged),
then the measure's units, then the compact default. An axis uses a
carrier only when every series bound to it carries the same one and that
carrier names a unit, either a currency or a `%` pattern
(`sharedMeasureFormat`). This is the same all-or-nothing rule
`plotsWholeNumbers` applies to `aggregate`. Data labels print with their
axis' formatter (objectstack#27372), so they carry the units too.
- **Percent:** printed through `formatMeasure` from `@object-ui/core`,
the function the table uses, at the column's own `percentScale`. The
pattern's places are the minimum and grow to the step's place (the
`formatterFor` rule), so two ticks never share a label. A `whole` rate
of 33.3 now reads `0.0%` … `36.0%`.
- **Currency:** printed as the compact default with the currency's
symbol (`CN¥3K` … `CN¥12K` in `en`, `¥30万` in `zh-CN`).
`compactTickFormatter` gains an optional `currency` argument. If `Intl`
refuses the code, the tick falls back to the plain compact number.
3. **The producers fill it.**
- `DatasetReportRenderer.tsx` (`measureFormatCarrier`) gives every drawn
series the measure's facts. That covers a `seriesBy` split and the
earlier-window series too.
- `DatasetWidget.tsx` gives each series the facts of the measure it
plots. A pivot uses its one measure; any other series uses its own
measure or that measure's earlier window. The dimensionless (transposed)
series carries a carrier only when every measure formats alike.
- Both producers take the currency from `measureCellCurrency(field)`
with no row. That is the currency the table prints a cell with when the
cell has no row of its own.
4. **The per-row currency carve-out.** A measure with a per-row
`currencyField` has no single axis currency. `measureCellCurrency`
returns none for it, so its carrier holds no currency and its axis keeps
the plain-number default. The pin for this is the control in each test
file.
5. **The fraction-scale path from PR objectstack-ai#37051 is unchanged.** The report
still passes `yAxis[0].format` for a fraction-scale percent, and a
declared axis format outranks the carrier. The `percentAxisFormat`
docblock now points to the carrier.

Responsibility: whose code is it? The platform's own
`@object-ui/plugin-charts` value axis, whose `format` key carries only a
d3 pattern. Is there an existing platform path? None: the table's
`formatMeasure` path never reaches the chart axis. Who reaches it? Every
report or dashboard chart over a whole-scale percent or currency
measure.

## Tests

The pins live in the shared harness of each mechanism, as AGENTS.md's
ruling record 6583487846 asks: each is a new top-level `describe` for
objectstack#37053 in the file that already holds the neighbouring pin.
Each SUBJECT is red with this card's source files at their `main` blobs
and green after (see Verification).

- `ui/packages/plugin-charts/src/AdvancedChartImpl.axisLabels.test.tsx`,
the axis-tick harness that holds the objectstack#36988 pin. It builds a
real chart through `normalizeChartSchema`, with the series carrier as a
producer hands it.
- A whole-scale percent's ticks are `['0.0%', '9.0%', '18.0%', '27.0%',
'36.0%']`. Each tick equals `formatMeasure(tick, '0.0%', undefined,
'whole', 'en')`, and the table's `33.3%` is the same function's output.
- A `CNY` measure's ticks are `['CN¥0', 'CN¥3K', 'CN¥6K', 'CN¥9K',
'CN¥12K']`, a `USD` measure's are `['$0', '$3K', '$6K', '$9K', '$12K']`,
and a `CNY` measure in a `zh-CN` session reads `['¥0', '¥30万', '¥60万',
'¥90万', '¥120万']`.
- CONTROL: a per-row currency measure (pattern, no currency) keeps
distinct plain ticks `['0', '3K', '6K', '9K', '12K']`.
  - Also pinned:
- a fraction-scale percent through the carrier alone (the dashboard's
case);
- a declared axis `format` wins over the carrier: `yAxis: [{ format:
'0,0' }]` over a `CNY` measure reads `0` … `12,000` with no `CN¥`. This
pin goes red when the order in `valueAxisTickFormatter` is swapped (see
Verification);
- the report's fraction-scale `yAxis[0].format` path still reads `0.0%`
… `34.0%` beside its carrier (PR objectstack-ai#37051);
    - a `'0%'` pattern on a 0.85-point step reads `0.00%` … `3.40%`;
    - data labels read `33.3%`;
    - two differently formatted series on one axis keep the default.
-
`ui/packages/plugin-report/src/__tests__/DatasetReportRenderer.chartChrome.test.tsx`,
the report chart-schema harness that holds the objectstack#36988 pin. It
checks the schema the registered chart receives:
- the carrier for a whole-scale percent, with the table's `33.3%` beside
it and still no `yAxis`;
  - the carrier for a `CNY` measure;
  - the per-row currency control, whose carrier has no currency;
  - every `seriesBy` series carrying the carrier;
  - a fraction-scale percent keeping its `yAxis[0].format`;
  - no carrier for a measure that states no facts.

`plugin-report` does not depend on `plugin-charts`, so this pin stops at
the schema. The chart harness above draws it, the same split the
objectstack#36988 pin uses.
-
`ui/packages/plugin-dashboard/src/__tests__/DatasetWidget.integerMeasureTicks-11681.test.tsx`,
the widget value-axis harness that holds the `aggregate` carrier's pins.
It renders the real chain (`DatasetWidget` → `SchemaRenderer` → `chart`
→ `AdvancedChartImpl`, no stub) and pins:
- the whole-scale percent widget (`0.0%` … `36.0%`, equal to
`formatMeasure`);
  - the `CNY` widget (`CN¥0` … `CN¥12K`);
  - the per-row currency control (`0` … `12K`);
- the transposed (dimensionless) series over two measures that format
alike reads `0.0%` … `36.0%`, and its control, a percent beside a
currency, keeps plain numbers;
- the comparison overlay (`compareColumn`) carries its measure's format,
so the axis keeps `0.0%` … `36.0%` with both windows drawn.
-
`ui/packages/plugin-report/src/__tests__/DatasetReportRenderer.comparePrevious-36645.test.tsx`,
the report compare harness: with 「Compare with previous period」 on, both
the current and the `amount__compare` series carry the `CNY` carrier,
and a measure with no format facts gives neither series one (the
control).
-
`ui/packages/plugin-report/src/__tests__/DatasetReportRenderer.measureFormatCarrierParity-37053.test.ts`
keeps the two copies of `measureFormatCarrier` in step. A shared copy
would belong in `@object-ui/core`, which is outside this card's surface,
so this pin holds them together instead. The pin has two halves:
- **Text:** the dashboard's copy is byte-identical to the report's, read
from source. A floor stops a slice that caught nothing from passing.
- **Behaviour:** the report's copy, over six field shapes plus no field,
answers the carrier the chart reads. Because the text is identical, the
same input field gives the same carrier in both producers.

No harness exists for a cross-producer pin, so this one has its own
file.

## Acceptance notes

- **Currency ticks are compact, not the table's full amount (a deviation
from route B's "through `formatMeasure`" wording for this one unit,
ruled A by the maintainer: 7153146695).** `formatMeasure` has no compact
notation. Its amount is the width of a cell (`CN¥12,000.00` in `en`,
`CN¥1,200,000.00` for a pipeline total), and every vertical value axis
is drawn 48 px wide (`VALUE_AXIS_WIDTH_PX`). The leading symbol is the
part that would be cut off. Widening the axis band was not taken because
the 48 px figure feeds the plot-width fit (`categoryLabelsFitBand`) and
the `X_AXIS_ALL_LABELS_MAX_BUCKETS` derivation. The compact reading with
the symbol is the convention the axis already uses for every amount. The
maintainer ruled this compact form, with the symbol from the same `Intl`
source the table uses (7153146695). The pins are the fixed-ISO currency
cases above (`CN¥0` … `CN¥12K`). Routing currency ticks through
`formatMeasure` with a `notation` option on `@object-ui/core` is a
follow-up card (objectstack-ai#37224).
- **Only two units travel: a `%` pattern and a single currency.** A
measure with a plain numeral pattern (no `%`, no currency, e.g.
`'0,0.00'`) keeps the compact default (`1.2M`), as before; its carrier
names no unit the axis prints, so `sharedMeasureFormat` passes it by.
- **`formatMeasure` prints a pattern's places as a fixed width.** So a
percent axis whose step needs more places than the pattern prints
trailing zeros (`0.00%` … `3.40%`), where `formatterFor` would print
`0%` … `3.4%`. The labels stay distinct and each one is the table's
reading of that number.
- **The by-name refusal of `series[].measureFormat` in
`@object-ui/types` is not in this PR; it is objectstack-ai#37214.** Refusing a key
that the published loose `ChartDataSeriesSchema` accepts narrows what an
author can write. That is `Clause-②: yes (narrowing)` with
`Metadata-protocol: narrowed`, and under ADR-0087 it owes a semantic
ledger entry under `packages/spec/src/migrations/entries/semantic/`.
Seat repo:objectstack#4 ruled to keep this PR non-breaking (widening
only), with no spec change. The refusal, its pin and the drafted ledger
entry go to objectstack-ai#37214, which carries its own L2 and dogfood run. **Until
objectstack-ai#37214 lands, the carrier is author-writable on a static SDUI chart
node:** a hand-written `measureFormat` there is honoured. The spec's
strict `ChartSeriesSchema` already refuses the key.
- **`measureFormatCarrier` is written twice**, once in each producer.
Its shared home (`@object-ui/core`, beside `buildChartSeries`'
`aggregateOf`) is outside this card's file surface, so the two copies
are exported from their modules (not from either package's entry),
cross-referenced in their docblocks, and held identical by the parity
pin above.
- **The file surface as read.** "The chart renderer's internal props
type beside it" was read as the internal series types:
`NormalizedSeries` and its reader `normalizeSeries` in
`normalizeChartSchema.ts`, and the `dataKey` arm in `ChartRenderer.tsx`.
Those are where `series[].aggregate`, the named precedent, lives. The
pure formatter helpers (`sharedMeasureFormat`, `measureTickFormatter`,
and the `currency` argument of `compactTickFormatter`) sit in the same
file, beside `formatterFor` and `compactTickFormatter`.
- **Not in this card:**
  - tooltips keep their own value text;
- object-bound charts (`ObjectChart` over `aggregate`) fill no carrier;
- a horizontal-bar chart's value axes (drawn across the plot) take the
same formatter, but this card does not pin them.

## Verification

Two-minute check: `cd ui && pnpm --filter @object-ui/plugin-charts exec
vitest run --root ../.. --maxWorkers=2
packages/plugin-charts/src/AdvancedChartImpl.axisLabels.test.tsx
packages/plugin-report/src/__tests__/DatasetReportRenderer.chartChrome.test.tsx
packages/plugin-report/src/__tests__/DatasetReportRenderer.comparePrevious-36645.test.tsx
packages/plugin-report/src/__tests__/DatasetReportRenderer.measureFormatCarrierParity-37053.test.ts
packages/plugin-dashboard/src/__tests__/DatasetWidget.integerMeasureTicks-11681.test.tsx`.
Expect 5 files and 85 tests to pass, among them the objectstack#37053
describes reading `0.0%` … `36.0%`, `CN¥0` … `CN¥12K`, `$12K` and
`¥30万`.

Read first, in order of risk:
1. `ui/packages/plugin-charts/src/normalizeChartSchema.ts`:
`measureTickFormatter` (the places rule at the displayed scale) and
`sharedMeasureFormat` (when an axis takes a carrier).
2. `ui/packages/plugin-dashboard/src/DatasetWidget.tsx`:
`seriesMeasureFormat` (which measure a series plots, including the
transposed and comparison series).
3. `ui/packages/plugin-charts/src/AdvancedChartImpl.tsx`: the precedence
in `valueAxisTickFormatter`.

<details><summary>Package suites and type-check at 8816da6 (after
merging origin/main)</summary>

- `pnpm --filter @object-ui/plugin-charts exec vitest run --root ../..
--maxWorkers=2 packages/plugin-charts/ packages/plugin-report/
packages/plugin-dashboard/ packages/types/`: Test Files 749 passed
(749), Tests 14386 passed, 22 skipped. Exit 0, run under the verify
lock.
- `pnpm --filter @object-ui/types --filter @object-ui/plugin-charts
--filter @object-ui/plugin-report --filter @object-ui/plugin-dashboard
run type-check` (all four script names echoed): exit 0.
</details>

<details><summary>Ablations and red on main</summary>

Both ablation legs ran under the verify lock at HEAD 8816da6, over
the five harness files in the two-minute check (85 tests). Each leg was
restored to blob 4811aff == HEAD, with `git diff HEAD` empty.

- **Leg A, the carrier read:** `scripts/ablation-replace.mjs` deleted
`?? measureTickFormatter(sharedMeasureFormat(plotted), displayLocale,
exponent)` from `AdvancedChartImpl.tsx` (anchor 1 → 0, blob 4811aff →
4faad709). Result: 11 failed, 74 passed.
- The 7 chart cases that need the carrier failed: whole-scale percent,
`CNY`, `USD`, `zh-CN`, fraction through the carrier, the coarse pattern
and data labels.
- The 4 widget cases failed: percent, `CNY`, the transposed series and
the comparison overlay.
- The controls stayed green: per-row currency, the mixed series, the
mixed transposed series, the declared `0,0` axis and the fraction
`yAxis[0].format` path. The report schema pins, the compare pins and the
parity pin stayed green too, as producer pins should.
- **Leg B, the precedence swapped (the seat's S1):** the replacement
made `valueAxisTickFormatter` read the carrier before a declared axis
`format` (anchor 1 → 0, blob 4811aff → c948f168). Result: 1 failed, 84
passed. The one failure is "a declared axis `format` wins over the
carrier", the pin S1 asked for.
- **Red on main**, taken at c8a011b before the harness move, over the
same assertions: the five edited source files were set to their `main`
(95734fe) blobs, with hashes checked on disk. Result: 12 failed, 5
passed. Each file was restored to its HEAD blob, and both `git diff
HEAD` and the porcelain were empty. The round-2 producer pins were not
run on main. On main no series carries `measureFormat`, so their carrier
expectations fail by construction.
</details>

<details><summary>Derived gate families (dispatch-gates --commands, 40
families, tree 8816da6)</summary>

All 40 exited 0 when re-run on this head, with the exit code captured
before any pipe. `pnpm --dir ui exec vitest run --maxWorkers=2 scripts/`
(under the lock) reported Test Files 172 passed, 2 skipped, and Tests
5130 passed. `dispatch-gates --ran`: 40 derived, 40 run, 0 NOT-MEASURED,
0 UNRUN. The CI-owned families are read from this PR's check-runs.
</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D)_

<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYmRepQK9DkZeU7F53D -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants