Increase the height of the diagram

Hi,

I am creating different diagrams, some by using TreeLayout and some by using simple Group Layout. Now, as the data increases the scroll bar appears in the diagram. So, I just want to avoid this scroll bar and the height of the diagram increases automatically depending on the data.

How I can achieve this? Please let me know.

Thanks.

set Diagram.autoScale to a value like go.Diagram.Uniform

Hi Simon,

But by setting autoScale to goDiagram.Uniform makes the diagram so compressed and it zoomtofit on the screen. I don’t want like that I want to increase the height of the diagram according to the length of the diagram. Suppose, if diagram contains less data then height should be suppose 600px and as the data increase, the height increases too. How I can achieve this pro-grammatically?

Thanks.

First, try setting Diagram.autoScale to go.Diagram.UniformToFill to see if the results are acceptable.

Second if you are actually talking about increasing the height of the DIV, you can do that, but we recommend against doing so unconditionally. The contents of a diagram, whose area in document coordinates is given by Diagram.documentBounds, might be extremely tall – too tall for any browser to support without resulting in errors.

Hi Walter,
Thanks for your response.

I have sorted out this by calculating the maximum of the heights of actualbounds and then set that maximum height and it gives me my desired result.