Autosize Y, but still keep X scroll.

Hi all,

Love this library, so thanks for that.

Quick question about scrolling.

Currently as I have my gantt, I have a fixed height, and can scroll both in the X and Y directions.
However, I want the gantt to expand it’s height dynamically. In order to do this, I use the following setting.

gantt.config.autosize = "y"

This works, however it breaks the horizontal scroll. (Can no longer scroll horizontally).
What’s the best way to achieve both horizontal scroll and dynamic height expansion?

Thanks in advance!

If you still want to keep X scroll, you also should set autosize for X axis.
gantt.config.autosize = “xy”
Because if you set only ‘y’, Gantt can’t change width automatically to make all the content visible.
How it works please check in the snippet:

Thanks Polina, however I would still like to cap the width of my Gantt chart. If I keep both “xy”, and if my Gantt chart width is an enormously large amount, is there a way to cap the width and allow a scroll within a max-width?