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

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.

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