2

如何计算在 gojs 中以编程方式创建的图表的高度。

我有 myDiagram.nodeTemplate 后跟 myDiagram.groupTemplate

我得到 myDiagram.actualBounds 未定义。myDiagram.outerBounds 的高度未定义。

我知道一旦计算出来我必须打电话:

var div = diagram.div;
div.style.width = 'I need to calculate this!!!';
diagram.requestUpdate();

但我不知道我的图表是什么宽度。

任何人都可以请帮忙。

4

1 回答 1

3

你想要的Diagram.documentBounds.width可能性最大。

你见过吗:http: //forum.nwoods.com/t/is-it-possible-to-have-dynamic-height-on-canvas/6450

于 2016-01-20T05:32:03.193 回答