briandijkstra1984
Posts: 5
Joined: Thu Jan 02, 2025 12:34 pm

Collapse and expand sub items

Hello,

I have a Gantt chart with is there a option to collapse all items when i load the page?
Also when i filter i want the items to be closed.

Example: https://stackblitz.com/edit/vitejs-vite ... %2Fmain.js

Brian
andrzej.b
Site Moderator
Posts: 611
Joined: Mon Jul 15, 2024 12:34 pm

Re: Collapse and expand sub items

Hi,

Thanks for reaching out with your question.

To collapse all items when the Gantt chart loads and when you apply a filter, you can set the collapsed property to true for each parent task in your data.
API reference: https://api.highcharts.com/gantt/series ... .collapsed

Demo: https://jsfiddle.net/BlackLabel/b8L1fz7g/

Feel free to reach out if you have any further questions.

Kind regards,
Andrzej
Highcharts Developer
briandijkstra1984
Posts: 5
Joined: Thu Jan 02, 2025 12:34 pm

Re: Collapse and expand sub items

Hi, i think you added the wrong demo example?
andrzej.b
Site Moderator
Posts: 611
Joined: Mon Jul 15, 2024 12:34 pm

Re: Collapse and expand sub items

Hi, apologies.

The link is fixed, though it shouldn't be needed actually, as you have everything you need in the documentation.

Best,
Andrzej
Highcharts Developer

Return to “Highcharts Gantt”