Repository navigation
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 #5141
Description
Summary
A dataset-bound report chart labels its measure axis with the measure's name (potential_upside_tons) instead of its authored label (可抢吨位(吨)). The table in the very same report resolves the same measure's label correctly, and a dashboard chart bound to the same dataset and measure also resolves it correctly — so this is the report chart renderer specifically, not a missing label and not a dataset problem.
The visible result on a Chinese console is a snake_case English identifier printed under an otherwise fully-translated chart.
Evidence
@objectstack/* 17.0.0-rc.1, fresh database, browser locale zh-CN.
Dataset (heimao_account_metrics) — the measure carries a label:
{ name: 'potential_upside_tons', label: '可抢吨位(吨)', aggregate: 'sum', field: 'competitor_supply_volume', format: '0,0' }Report (heimao_key_account_attack_list):
chart: {
type: 'horizontal-bar',
title: '各客户可抢吨位',
showLegend: false,
xAxis: 'account_name',
yAxis: 'potential_upside_tons',
}Rendered, on one screen:
| element | renders |
|---|---|
| chart title | 各客户可抢吨位 ✅ (chart's own title) |
| chart measure-axis title | potential_upside_tons ❌ |
| summary-table column header for the same measure | 可抢吨位(吨) ✅ |
Three reports, three measures, same failure — the axis always prints name, the table always prints label:
| report | measure | axis renders | table renders |
|---|---|---|---|
heimao_key_account_attack_list |
potential_upside_tons |
potential_upside_tons |
可抢吨位(吨) |
heimao_customer_grade_distribution |
account_count |
account_count |
客户数 |
heimao_annual_supply_trend |
shipped_volume_tons |
shipped_volume_tons |
发货量(吨) |
The contrast that localizes the bug
A dashboard widget bound to the same dataset family resolves the label without any extra authoring:
{
id: 'hm_annual_supply_trend',
type: 'bar',
dataset: 'heimao_supply_history_metrics',
dimensions: ['year'],
values: ['shipped_volume_tons'], // no label authored here
}renders its axis as 发货量(吨) — the dataset measure's label. Same measure name, same dataset layer, correct resolution. So the measure catalog is reachable at render time; the report chart path just does not consult it.
series[].label does not help
ReportChartSchema documents a series array with an optional label, which reads like the intended override. It has no effect:
chart: {
type: 'horizontal-bar',
xAxis: 'account_name',
yAxis: 'potential_upside_tons',
series: [{ name: 'potential_upside_tons', label: '可抢吨位(吨)' }], // ← added
}Rebuilt, restarted, re-measured: the axis still renders potential_upside_tons. Verified for all three reports above. The change was reverted in our tree rather than left in, since it is inert metadata.
That leaves an app with no authorable way to control this string — neither the dataset measure label nor the chart's own series label reaches it.
Suggested fix
In the report chart renderer (DatasetReportRenderer / useDatasetRows path), resolve the axis/series display name the way the summary table already does:
chart.series[].labelwhen the measure is named there, then- the bound dataset's
measures[].label, then - the measure
nameas a last resort.
Honouring (1) alone would unblock apps immediately; (2) is what makes the default correct without per-chart authoring, and is what the dashboard renderer already does.
Related
- View labels never resolve a translation —
resolveViewLabelreads two fields the served view document does not have #4854 — view / report / dataset labels have no live translation path. Adjacent but distinct: this one is not about i18n bundles at all, it is the authored label being dropped. - Analytics surfaces resolve select-option labels but never apply the i18n bundle — reports and dashboards show English while lists and forms show the translation #5076 — analytics surfaces resolve select-option labels but skip the i18n bundle.
Filed from a downstream app (hotcrm-heimao), tracked there as issue #60.
Activity
os-zhuang commentedon Aug 5, 2026
分诊:补
pm:queue(既有repo:objectui路由沿用,此前只有路由半边、缺分类半边)。落点:objectui 报表 chart 渲染面(
DatasetReportRenderer/useDatasetRows路径的轴/系列显示名解析)。正文已把缺陷收敛到 report chart 一条路径:同 dataset 同 measure 在 summary table 与 dashboard widget 均解析label正常,且series[].label实测失效 —— 修向按正文三级回落(series[].label → dataset measures[].label → name)即可。与 #4854 / #5076(i18n bundle 面)的区分论证成立:本单是 authored label 被丢,非翻译缺失。本评论来自分诊座位 Routine(#5474 试点),不构成认领。
Generated by Claude Code
os-zhuang commentedon Aug 10, 2026
Migrated to objectstack-ai/objectui#4020 under #7167 (file-at-destination ruling, maintainer 2026-08-10). Native GitHub issue transfer is not available to this session's credential, so the card was recreated at the destination; this thread stays as the authoritative history and is linked from the new card. Closing as not planned here — moved, not rejected.
Generated by Claude Code