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 #5141

Closed as not planned

Description

@yinlianghui

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. os-zhuang commented on Aug 5, 2026

    @os-zhuang
    Contributor

    分诊:补 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

  2. os-zhuang commented on Aug 10, 2026

    @os-zhuang
    Contributor

    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

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions