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

Charts aren't correctly displayed when the fixed width CSS constraint is relaxed #687

Open yurivict opened 1 year ago

yurivict commented 1 year ago

Sometimes data has different width and having fixed width is impractical.

When this line is commented out charts aren't shown correctly when there is only one child:

image

Another example is: image

DCH1 commented 1 year ago

Hi @yurivict , I had similar problem and I think I managed to solve it.

1

I did not comment out the width, instead I replaced it with this: width:100%; min-width:130px;. After this I added flex-grow:2; in .orgchart .hierarchy.

2

dabeng commented 1 year ago

Hi @yurivict @DCH1 I have created new 30 demo on gh-pages for you -- nodes of different widths(https://dabeng.github.io/OrgChart/nodes-of-different-widths.html)

Paul75 commented 1 year ago

but in demo withs not semmes works .....