Skip to content

A report's embedded chart drops every authored chart chrome key — showLegend: false still draws a legend, colors / showDataLabels are inert #4877

Description

@yinlianghui

Summary

DatasetReportChart forwards only six keys to the registered chart component. Everything else ReportChartSchema declares as authorable chrome never leaves the report renderer, so it is inert metadata: the author writes it, the schema accepts it, nothing reads it.

Found while implementing #4020 (which fixes one neighbouring symptom — the measure display name — and deliberately does not widen). Filed separately because the fix is a different mechanism with different acceptance criteria.

Measured

Rendered a dataset-bound report whose chart authors showLegend: false, colors: ['#f00'] and showDataLabels: true, and captured the props the registered chart component was handed. The full key list:

chartType, data, height, isAnimationActive, series, xAxisKey

showLegend, colors and showDataLabels are simply absent. Downstream, AdvancedChartImpl computes legendVisible = showLegend !== false, so an absent value means the legend is on — the author's explicit false is not merely ignored, it is inverted in effect.

Source: packages/plugin-report/src/DatasetReportRenderer.tsx, the ChartComponent schema literal (the series: [...] / height block near the end of DatasetReportChart).

The declared-but-unread set

ReportChartSchema (spec page.zod) declares, and this path drops: showLegend, showDataLabels, colors, subtitle, description, annotations, interaction, aria. Also dropped are every series[] presentation key other than labelcolor, stack, type, yAxis, dashArray, opacity, variant. (title IS honoured: the renderer paints it as its own h3 above the chart. series[].label became live in #4020.)

Note this is the same card's evidence: the reporter's own report authored showLegend: false alongside the label defect.

Why it matters beyond cosmetics

normalizeChartSchema in plugin-charts already accepts every one of these keys — the translation layer is built and tested. The report path just never hands them over, so an AI-authored report that spells valid, schema-passing chart chrome renders as if it had authored nothing. That is the "declared = enforced" line: a key the schema accepts and no renderer reads is a trap for exactly the metadata authors this stack is built for.

Suggested direction

The dashboard solved this shape already — mergeAuthoredPresentation (packages/plugin-dashboard/src/DatasetWidget.tsx) merges the authored presentation onto the derived bindings under a ruled data/presentation split (#4229), keeping series MEMBERSHIP with the dataset. Reusing it here would need care: the report's chart.xAxis / chart.yAxis are bare dimension/measure NAME strings, not the ChartAxis objects that helper expects, so passing the report chart wholesale would feed axisPresentation a string and synthesise a meaningless empty y-axis entry. Scope it to the series + chrome keys, or lift the split into a shared helper both surfaces call.

Related

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions