Charts · console.warn
chart {key}: "{col}" names a column this grid does not have, so there is nothing to read and nothing to draw. The columns it does have: … Bind a column the grid declares, or declare the column.
Printed by Charts, prefixed [lattice], since 1.70.0.
Warnings reference › chart:*:missing-column
- Identifier
chart:*:missing-column- Raised by
- Charts
- Since
- 1.70.0
What happened
A column named in the chart spec is not a column of the grid. It is asked first, before emptiness, because a missing column does not produce an empty binding: every row answers undefined for it, which is one category or one null measure, so a chart bound to one would otherwise draw a complete frame around nothing. The chart shows its empty state instead, and the message lists the columns the grid does have.
The fix
Bind a column the grid declares - the id, not the header title - or declare the column on the grid. The spec key that named it (x, y, measures, source, target, …) is printed with it.
The smallest fix
createChart({ grid, container, type: 'bar', x: 'region', y: 'amount' });
Reference
Covered in full at the API reference.