Skip to content

A report's embedded chart never buckets a NULL category — the #4466 family fix lives in buildChartSeries, which the report path does not call #4878

Description

@yinlianghui

Summary

DatasetReportChart builds its chart rows as relabelDimensions(state.rows, dimensionLabels) and forwards them straight to the chart component. Nothing on that path buckets a null dimension value, so a report chart hands the renderer a null category — the exact input #4466 measured as drawing no mark at all.

The dashboard and chart-view surfaces do not have this problem because they route through buildChartSeries (packages/core/src/utils/chart-series.ts), whose bucketNullCategories limb is where #4466 / #4497 / #4673 / #4500 were all fixed. The report chart calls none of it.

Found while implementing #4020 on the same forwarding line; out of that card's scope, so filed here.

Measured

A dataset-bound report chart over rows containing a null group, capturing the props handed to the registered chart component:

data = [{"owner":null,"n":51},{"owner":"Dev Admin","n":2}]

The null reaches the renderer verbatim. On the dashboard path the same rows arrive as the bucket label ((None), localized per #4500) and draw a bar.

Why it matters

#4466 recorded that the cost is not an empty chart but a quietly wrong one: the dominant group vanishes while the y-axis scale still accommodates it, so the chart reads as valid data. A report chart is the surface most likely to be exported or read in a background tab, where there is no second view to cross-check against.

The report renderer is also missing the collision-safe bucketing that came with #4508 (a stored value literally spelling the bucket label) and the (None) localization of #4500 — those are properties of the shared helper, so they arrive together if the path is unified rather than re-implemented.

Suggested direction

Route the report chart's rows through buildChartSeries rather than passing state.rows through, so the whole null-category family is inherited instead of re-derived. Two things to check first, which is why this is not a one-liner:

  1. buildChartSeries also DERIVES the series (one per measure, with fields[].label). The report chart plots exactly one measure and, since Report charts render the raw dataset measure name as the axis title, ignoring the measure's label — the same measure on a dashboard chart resolves correctly #4020, resolves its display name through a three-level fallback that outranks the plain fields[].label pick. The authored chart.series[].label override must survive the switch.
  2. The null bucket label must come from the i18n bundle at the call site (@object-ui/core is React-free — see the nullCategoryLabel option and DatasetWidget renders the English '(None)' null-bucket floor in a zh app — one argument short of localized #4500), otherwise a zh console gains an English (None).

Related

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions