Skip to content

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

Closed

Description

@os-zhuang

Migrated from objectstack-ai/objectstack#5141 under the file-at-destination ruling (objectstack-ai/objectstack#7167, maintainer 2026-08-10). Originally filed 2026-08-04T06:02:35Z. The full prior thread — including triage rulings and hold/restart conditions — remains on the source issue and MUST be read before acting on this card.


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:

  1. chart.series[].label when the measure is named there, then
  2. the bound dataset's measures[].label, then
  3. the measure name as 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

Filed from a downstream app (hotcrm-heimao), tracked there as issue #60.

Activity

  1. self-assigned this
    on Aug 16, 2026
  2. yinlianghui commented on Aug 16, 2026

    @yinlianghui
    Contributor

    【认领】objectui 分片 PM(session_01GTRjn8xBqp75dk7kFupVRt)批次 14 派发,os-dev 实施。分支:claude/issue-4020-report-axis-measure-label。

    分诊判断:恢复一致性类(report 面对齐 table 与 dashboard 已有的 label 解析行为),按正文三级 fallback 实施 —— ①chart.series[].label ②数据集 measures[].label ③name 兜底;series[].label 从惰性变生效属于把 ReportChartSchema 已文档化的声明兑现(declared = enforced),非新契约。⚠️ 派发前置照正文硬规:objectstack#5141 源单全线程(含分诊裁定与 hold/restart 条件)必读后再动手;立卡至今 main 走了六天,先按 origin/main 复核 report 渲染路径现状。文件面:report chart 渲染路径(DatasetReportRenderer / useDatasetRows 所在,实读定位;#4692 的 AdvancedChartImpl 改动已落 main,从最新基切)+ 测试。在飞互斥:本批次当前仅此一单。


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpm:queue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions