ssb*_*sbb 17 javascript angularjs nvd3.js angularjs-nvd3-directives
我正在使用angular nvd3指令.
根据例子:https://github.com/angularjs-nvd3-directives/angularjs-nvd3-directives/blob/master/examples/lineChart.with.automatic.resize.html
<!--
width and height are removed from the directive for automatic resizing.
-->
Run Code Online (Sandbox Code Playgroud)
好吧,如果我更改图表的Div大小.它调整大小,但只有当我移动/打开/关闭'控制台视图'(FF上ctrl+ shift+ i)时.
我检查了angular-nvd3-directive,调整大小没有事件调用,所以我想这是一个d3/nvd3 comportement?
到目前为止我的问题:如何模拟这种事件以使图形调整大小?
您可以尝试触发另一个可以重新绘制图形的resize事件. window.dispatchEvent(new Event('resize'));
Chart.js也采用了类似的方法.当可见的控制台改变页面时,这很奇怪 - 仍然不完全理解它是如何工作的,但它会定期显示动态布局.
归档时间: |
|
查看次数: |
6848 次 |
最近记录: |