Charts ยท console.warn
chart "x" expects one column id (a string) a...
Printed by Charts, prefixed [lattice], since 1.55.0.
Warnings reference › chart:*:x:array
- Identifier
chart:*:x:array- Raised by
- Charts
- Since
- 1.55.0
What happened
x was an array on a type that does not read one. The hierarchical types (pie, donut, sunburst, treemap) read an array there as their levels top down, so for them it is not a mistake; a cartesian type has no such reading: the array reaches the grid's column lookup, which takes one id, so nothing resolves and the chart draws empty. The diagnostic is raised per chart and before the binding, so it precedes whatever the binding then makes of it.
The fix
Give x one column id. For a hierarchy, use a hierarchical type and name the levels in the array - x: ['region', 'product'] - or group the grid and let the type read the grouping.
The smallest fix
createChart({ grid, container, type: 'sunburst', x: ['region', 'product'], y: 'charge' });
Reference
Covered in full at the API reference.