You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2025/07/22 06:27:04 UTC

(echarts) 01/01: fix(radar): improve logic and add test cases of #21081

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

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

commit 0c2a305ed448600346d447ca9d6d792a80b7fd43
Author: Ovilia <zw...@gmail.com>
AuthorDate: Tue Jul 22 14:26:42 2025 +0800

    fix(radar): improve logic and add test cases of #21081
---
 src/chart/radar/RadarView.ts       |  3 ---
 test/radar.html                    |  6 ++++--
 test/runTest/actions/__meta__.json |  2 +-
 test/runTest/actions/radar.json    |  2 +-
 test/runTest/marks/radar.json      | 10 ++++++++++
 5 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/chart/radar/RadarView.ts b/src/chart/radar/RadarView.ts
index 0cd0991f7..a0509b881 100644
--- a/src/chart/radar/RadarView.ts
+++ b/src/chart/radar/RadarView.ts
@@ -232,7 +232,6 @@ class RadarView extends ChartView {
                 )
             );
             const emphasisModel = itemModel.getModel('emphasis');
-            const itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();
             symbolGroup.eachChild(function (symbolPath: RadarSymbol) {
                 if (symbolPath instanceof ZRImage) {
                     const pathStyle = symbolPath.style;
@@ -249,8 +248,6 @@ class RadarView extends ChartView {
                     symbolPath.style.strokeNoScale = true;
                 }
 
-                const pathEmphasisState = symbolPath.ensureState('emphasis');
-                pathEmphasisState.style = zrUtil.clone(itemHoverStyle);
                 let defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx);
                 (defaultText == null || isNaN(defaultText as number)) && (defaultText = '');
 
diff --git a/test/radar.html b/test/radar.html
index 540afaee5..c71bf9209 100644
--- a/test/radar.html
+++ b/test/radar.html
@@ -95,12 +95,13 @@ under the License.
                                 name: '第一个元素是 null'
                             }
                         ],
-                        emphasis: { 
+                        emphasis: {
                             focus: 'self',
                             lineStyle: {
                                 width: 4,
                             },
                             itemStyle: {
+                                color: 'blue',
                                 borderColor: null,
                                 borderWidth: 2,
                                 opacity: 0.4,
@@ -111,8 +112,9 @@ under the License.
                                 opacity: 0.3,
                             },
                             itemStyle: {
-                                opacity: 0.2,
+                                opacity: 0.8,
                                 shadowBlur: 5,
+                                color: 'red'
                             },
                         },
                         symbol: 'triangle',
diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json
index 586bc8d00..510b29981 100644
--- a/test/runTest/actions/__meta__.json
+++ b/test/runTest/actions/__meta__.json
@@ -178,7 +178,7 @@
   "polar-rounded": 3,
   "polarLine": 1,
   "polarScatter": 1,
-  "radar": 2,
+  "radar": 3,
   "radar2": 1,
   "radar3": 2,
   "radar4": 1,
diff --git a/test/runTest/actions/radar.json b/test/runTest/actions/radar.json
index 78fd324c4..d6f1afcee 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
diff --git a/test/runTest/marks/radar.json b/test/runTest/marks/radar.json
new file mode 100644
index 000000000..a31dc49bd
--- /dev/null
+++ b/test/runTest/marks/radar.json
@@ -0,0 +1,10 @@
+[
+  {
+    "link": "https://github.com/apache/echarts/pull/21081",
+    "comment": "fix(radar): itemStyle of emphasis not working",
+    "type": "Bug Fixing",
+    "markedBy": "Ovilia",
+    "lastVersion": "6.0.0-beta.1",
+    "markTime": 1753165510342
+  }
+]
\ 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