diff --git a/src/chart/graph/GraphView.ts b/src/chart/graph/GraphView.ts index d5f51eba4c..f4559521fb 100644 --- a/src/chart/graph/GraphView.ts +++ b/src/chart/graph/GraphView.ts @@ -208,6 +208,8 @@ class GraphView extends ChartView { } dispose() { + this.remove(); + this._controller && this._controller.dispose(); this._controllerHost = null; } @@ -300,7 +302,11 @@ class GraphView extends ChartView { this._lineDraw.updateLayout(); } - remove(ecModel: GlobalModel, api: ExtensionAPI) { + remove() { + clearTimeout(this._layoutTimeout); + this._layouting = false; + this._layoutTimeout = null; + this._symbolDraw && this._symbolDraw.remove(); this._lineDraw && this._lineDraw.remove(); } diff --git a/test/graph-case.html b/test/graph-case.html index 7f199f5a4a..4523593c7b 100644 --- a/test/graph-case.html +++ b/test/graph-case.html @@ -39,7 +39,7 @@
- + @@ -154,6 +154,61 @@ }); +