Gantt ยท console.warn
gantt: mount was given both zoom ({zoom}) and width ({width}); zoom fixes the pixels-per-day, so the width is ignored and the plot scrolls. Drop one of the two.
Printed by Gantt, prefixed [lattice], since 1.52.0.
Warnings reference › gantt.zoomWidth:*
- Identifier
gantt.zoomWidth:*- Raised by
- Gantt
- Since
- 1.52.0
What happened
zoom and an explicit width are two ways of deciding the same thing. zoom fixes how many pixels a day gets, which decides the plot's width; the width you passed is therefore ignored and the plot scrolls inside its container instead of being squeezed to fit. Only a width you actually passed is reported - the default 'container' is not a conflict.
The fix
Keep zoom for a fixed day scale with scrolling, or keep width for a plot that fits a box. Not both.
The smallest fix
gantt.mount(el, { zoom: 'week' });
Reference
Covered in full at the API reference.