wangshijun / angular-echarts

:chart: angularjs bindings for baidu echarts
355 stars 141 forks source link

希望能够增加窗口大小变化时,resize图表,谢谢! #65

Closed eWeiMe closed 6 years ago

wsdmakeup commented 7 years ago

可以通过watch chart 的parent变化来通知chart resize, 在directive.js 里面添加。 我试了有效果,但是resize响应有一点点延迟

scope.$watch(function (){return element.parent()[0].clientWidth}, function(newValue) {
    if (newValue){
        chart.resize({width: newValue});
    }
}, true);
ArvinChen9539 commented 6 years ago

楼上太6了 我都不知道还可以这样监听....

seekei commented 6 years ago

你好,请问多个图表在同一页面的时候应该如何自适应 @wangshijun @wsdmakeup