pissang commented on a change in pull request #15847:
URL: https://github.com/apache/echarts/pull/15847#discussion_r725748215



##########
File path: src/chart/line/LineView.ts
##########
@@ -877,9 +882,46 @@ class LineView extends ChartView {
         this._points = points;
         this._step = step;
         this._valueOrigin = valueOrigin;
+        this.mouseEvent(seriesModel, api);
     }
 
-    dispose() {}
+    dispose() { 
+        this._polyline.off('click').off('mouseover');
+        this._polygon && this._polygon.off('click').off('mouseover');
+    }
+
+    mouseEvent(seriesModel: LineSeriesModel, api: ExtensionAPI) {

Review comment:
       There is no need to bind event manually in the series. ECharts will 
trigger events for elements with `eventData ` data. Check the reference usage 
in:
   
https://github.com/apache/echarts/blob/fde66eca74144f78c4299ac101f3c434bc57e5c1/src/component/axis/AxisBuilder.ts#L464
   
https://github.com/apache/echarts/blob/8f48ad285134a0a5907c19e479ae6c5bc270228a/src/chart/treemap/Breadcrumb.ts#L191




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to