You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/10/17 08:22:55 UTC

[GitHub] [echarts] plainheart commented on a change in pull request #15847: Feat(line): mouse event on polyline and polygon

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



##########
File path: src/chart/line/LineSeries.ts
##########
@@ -118,6 +118,8 @@ export interface LineSeriesOption extends SeriesOption<LineStateOption<CallbackD
     showAllSymbol?: 'auto' | boolean
 
     data?: (LineDataValue | LineDataItemOption)[]
+
+    enableLineEvent?: boolean

Review comment:
       How about naming it `triggerEvent`? It has been used somewhere.

##########
File path: src/chart/line/LineView.ts
##########
@@ -877,9 +879,23 @@ class LineView extends ChartView {
         this._points = points;
         this._step = step;
         this._valueOrigin = valueOrigin;
+
+        if (seriesModel.get('enableLineEvent')) {
+            this._mouseEvent(seriesModel, polyline);
+            polygon && this._mouseEvent(seriesModel, polygon);
+        }
     }
 
-    dispose() {}
+    private _mouseEvent(seriesModel: LineSeriesModel, el: Element) {

Review comment:
       Also, it may be better to name it `packEventData`.




-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org