Lattice Grid Buy a licence

Charts ยท console.warn

"viewportFilter" filtered the grid by the x ...

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

Warnings reference › chart:*:viewportFilter:y

Identifier
chart:*:viewportFilter:y
Raised by
Charts
Since
1.87.0

What happened

The chart is zoomed on its measure axis and its grid follows the zoom, but the y values drawn are reductions (a sum, a mean) over the rows at each x, so there is no row value to filter by. The grid was filtered to the x range alone.

The fix

Nothing, if the x range is what you want the grid to follow. To filter by y as well, chart one row per point: a scatter or bubble whose x is unique per row.

The smallest fix

createChart({ grid, container, type: 'scatter', x: 'risk', y: 'return', zoom: { axes: 'xy' }, viewportFilter: true });

Reference

Covered in full at the API reference.