How can set dinamic size?
Opened this issue · 3 comments
Hello, i use this for create dinamic FlowChart, it's work fine but how i can set dinamic size for draw?
When i have many process i can't see all but the svg is cut. Thank you
If I understand you correctly you are asking about scaling the SVG image. Here is a starting point for you to experiment with. Instead of using an ordinary div for the placement of the chart, use an SVG element with a viewbox attribute, setting the width and height. For example:
<svg id="drawing" viewBox="0 0 900 900">
By increasing or decreasing the width and height relative to the chart width, but preserving the aspect ratio, you should be able to scale the chart.
By experimenting with the viewbox attribute I think you should be able to achieve what is required.
Not work so fine. If i no set size when declare flowSVG.draw(SVG('drawing').size(900, 900));
I need that height is dynamic. At moment i resolve with public value that i calculate 200*N Box
I'm not sure what you are doing here exactly. If you are trying to pass a calculated / dynamic value to the chart initialisation, you probably need to ensure that the page has loaded, or that the value has been initialised, before initialising the chart.