Lattice Grid Buy a licence

Charts ยท console.warn

axis.x.min ({min}) is not below axis.x.max (...

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

Warnings reference › chart.axis.x.domain.inverted

Identifier
chart.axis.x.domain.inverted
Raised by
Charts
Since
1.72.0

What happened

Both ends of a continuous x axis were pinned, and min was not below max. Drawing that domain would run the axis backwards, so both pins were dropped and the axis took its extent from the data instead.

The fix

Order the pair, and check the units: a time axis is pinned in epoch milliseconds, so new Date(...) has to be .getTime().

The smallest fix

createChart({ grid, container, axis: { x: { min: from.getTime(), max: to.getTime() } } });

Reference

Covered in full at the API reference.