Lattice Grid Buy a licence

Charts ยท console.warn

a brush on the {axis} axis would filter rows...

Printed by Charts, prefixed [lattice], since 1.86.2.

Warnings reference › chart:*:brush:aggregate

Identifier
chart:*:brush:aggregate
Raised by
Charts
Since
1.86.2

What happened

brush: { mode: 'filter', axis: 'y' | 'y2' } filters the measure behind the dragged axis, which only means something when each mark is one row's own value. Here a mark stands for several rows, or the reduction is a count, so a range of the drawn values cannot be turned into a condition on rows; nothing was written rather than a filter on numbers no row holds.

The fix

Brush the x axis (the default), or chart one row per mark: a scatter, or a line whose x is unique per row with a sum, avg, min or max reduction.

The smallest fix

createChart({ grid, container, type: 'scatter', x: 'risk', y: 'return', brush: { mode: 'filter', axis: 'y' } });

Reference

Covered in full at the API reference.