You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by yu...@apache.org on 2020/01/06 11:18:08 UTC

[incubator-echarts] branch fix-11801 created (now 2039e1d)

This is an automated email from the ASF dual-hosted git repository.

yufeng04 pushed a change to branch fix-11801
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git.


      at 2039e1d  fix bug #11801 Throw error when the action 'showTip' dispatched

This branch includes the following new commits:

     new 2039e1d  fix bug #11801 Throw error when the action 'showTip' dispatched

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[incubator-echarts] 01/01: fix bug #11801 Throw error when the action 'showTip' dispatched

Posted by yu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yufeng04 pushed a commit to branch fix-11801
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 2039e1d3fcb237362fcb63d9fc16e800eca2c4e7
Author: yufeng04 <yu...@baidu.com>
AuthorDate: Mon Jan 6 19:17:20 2020 +0800

    fix bug #11801 Throw error when the action 'showTip' dispatched
---
 src/chart/radar/RadarSeries.js     | 22 ++++++++++++++++++++++
 test/radar.html                    | 15 ++++++++++++---
 test/runTest/actions/__meta__.json |  2 +-
 test/runTest/actions/radar.json    |  2 +-
 4 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/src/chart/radar/RadarSeries.js b/src/chart/radar/RadarSeries.js
index 8d6d7b4..6bd5ee1 100644
--- a/src/chart/radar/RadarSeries.js
+++ b/src/chart/radar/RadarSeries.js
@@ -61,6 +61,28 @@ var RadarSeries = SeriesModel.extend({
             }).join('<br />');
     },
 
+    /**
+     * @implement
+     */
+    getTooltipPosition: function (dataIndex) {
+        if (dataIndex != null) {
+            var data = this.getData();
+            var coordSys = this.coordinateSystem;
+            var values = data.getValues(
+                zrUtil.map(coordSys.dimensions, function (dim) {
+                    return data.mapDimension(dim);
+                }), dataIndex, true
+            );
+
+            for (var i = 0, len = values.length; i < len; i++) {
+                if (!isNaN(values[i])) {
+                    var indicatorAxis = coordSys._indicatorAxes[i];
+                    return coordSys.coordToPoint(indicatorAxis.dataToCoord(values[i]), i);
+                }
+            }
+        }
+    },
+
     defaultOption: {
         zlevel: 0,
         z: 2,
diff --git a/test/radar.html b/test/radar.html
index 4ab8f19..c071474 100644
--- a/test/radar.html
+++ b/test/radar.html
@@ -93,10 +93,19 @@ under the License.
                         ]
                     }]
                 });
-
+                var theIndex = 2;
                 chart.on('click', function (params) {
-                    console.log(params)
-                })
+                    console.log(params);
+                    if (theIndex < 0) {
+                        theIndex = 2;
+                    }
+                    chart.dispatchAction({
+                        type: 'showTip',
+                        seriesIndex: 0,
+                        dataIndex: theIndex
+                    });
+                    theIndex--;
+                });
             });
 
         </script>
diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json
index b1e898d..f643c59 100644
--- a/test/runTest/actions/__meta__.json
+++ b/test/runTest/actions/__meta__.json
@@ -112,7 +112,7 @@
   "polar-rounded": 3,
   "polarLine": 1,
   "polarScatter": 1,
-  "radar": 1,
+  "radar": 2,
   "radar2": 1,
   "radar3": 1,
   "radar4": 1,
diff --git a/test/runTest/actions/radar.json b/test/runTest/actions/radar.json
index a7cb593..78fd324 100644
--- a/test/runTest/actions/radar.json
+++ b/test/runTest/actions/radar.json
@@ -1 +1 @@
-[{"name":"Action 1","ops":[{"type":"mousedown","time":340,"x":163,"y":20},{"type":"mouseup","time":450,"x":163,"y":20},{"time":451,"delay":500,"type":"screenshot-auto"},{"type":"mousemove","time":510,"x":168,"y":20},{"type":"mousemove","time":711,"x":320,"y":20},{"type":"mousemove","time":916,"x":339,"y":19},{"type":"mousedown","time":967,"x":339,"y":19},{"type":"mouseup","time":1060,"x":339,"y":19},{"time":1061,"delay":500,"type":"screenshot-auto"},{"type":"mousemove","time":1161,"x":34 [...]
\ No newline at end of file
+[{"name":"Action 1","ops":[{"type":"mousedown","time":340,"x":163,"y":20},{"type":"mouseup","time":450,"x":163,"y":20},{"time":451,"delay":500,"type":"screenshot-auto"},{"type":"mousemove","time":510,"x":168,"y":20},{"type":"mousemove","time":711,"x":320,"y":20},{"type":"mousemove","time":916,"x":339,"y":19},{"type":"mousedown","time":967,"x":339,"y":19},{"type":"mouseup","time":1060,"x":339,"y":19},{"time":1061,"delay":500,"type":"screenshot-auto"},{"type":"mousemove","time":1161,"x":34 [...]
\ No newline at end of file


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