dabeng / OrgChart

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
MIT License
2.86k stars 768 forks source link

Prevent .orgchart div from stretching #chart-container div #655

Closed valentinomariotto closed 1 year ago

valentinomariotto commented 2 years ago

Hi, not really an issue, just a request for help. Is there a way to prevent <div class="orgchart"> from stretching its container, <div id="chart-container">?

In my case, #chart-container is a flex item which uses all the available height and width. I'm using Orgchart with the Pan and Zoom options. When the chart is initialized, if it's wider than the available space, the overflow is hidden, and that's good. But that doesn't happen with the height. If I explore the whole tree, it grows its containers and eventually expands <div id="chart-container"> too. I would like to prevent that. I tried to set overflow: hidden with both css and jquery after the chart initialization, but it isn't working.

valentinomariotto commented 1 year ago

setting these properties on #chart-container did the trick

width:0;
min-width:100%;