From 8f39f80d4fc34fb434b9c7ec5bec55b74c32dc94 Mon Sep 17 00:00:00 2001 From: lang Date: Thu, 12 Nov 2015 19:18:57 +0800 Subject: [PATCH] Resize --- src/echarts.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/echarts.js b/src/echarts.js index 4f2c9c514..5658eadce 100644 --- a/src/echarts.js +++ b/src/echarts.js @@ -93,6 +93,9 @@ define(function (require) { // Init mouse events this._initEvents(); + + // In case some people write `window.onresize = chart.resize` + this.resize = zrUtil.bind(this.resize, this); } var echartsProto = ECharts.prototype; @@ -230,22 +233,17 @@ define(function (require) { this._invokeUpdateMethod('updateLayout', ecModel, payload); }; + /** + * Resize the chart + */ echartsProto.resize = function () { - // var ecModel = this._model; - - // this._coordinateSystem.resize(ecModel, this._extensionAPI); - - // this._doVisualCoding(ecModel); - - // this._doLayout(ecModel); - - // this._doRender(ecModel); - + this._zr.resize(); this.update(); }; /** - * @return {[type]} [description] + * @param {Object} eventObj + * @return {Object} */ echartsProto.makeActionFromEvent = function (eventObj) { var payload = zrUtil.extend({}, eventObj); -- GitLab