You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/06/11 04:34:46 UTC
[incubator-echarts] branch master updated: fix(radar): symbolRotate
does not work for radar series.
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
The following commit(s) were added to refs/heads/master by this push:
new 40a6279 fix(radar): symbolRotate does not work for radar series.
new 3bb072c Merge pull request #12695 from plainheart/fix-radar-symbolRotate
40a6279 is described below
commit 40a6279f29d5b4e7c1b8853698f80a315fd44151
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Mon May 25 19:50:24 2020 +0800
fix(radar): symbolRotate does not work for radar series.
---
src/chart/radar/RadarView.js | 6 ++++--
test/radar.html | 9 +++++++--
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/chart/radar/RadarView.js b/src/chart/radar/RadarView.js
index ac9c7d9..03748e7 100644
--- a/src/chart/radar/RadarView.js
+++ b/src/chart/radar/RadarView.js
@@ -52,12 +52,14 @@ export default echarts.extendChartView({
var symbolPath = symbolUtil.createSymbol(
symbolType, -1, -1, 2, 2, color
);
+ var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;
symbolPath.attr({
style: {
strokeNoScale: true
},
z2: 100,
- scale: [symbolSize[0] / 2, symbolSize[1] / 2]
+ scale: [symbolSize[0] / 2, symbolSize[1] / 2],
+ rotation: symbolRotate * Math.PI / 180 || 0
});
return symbolPath;
}
@@ -226,4 +228,4 @@ export default echarts.extendChartView({
},
dispose: function () {}
-});
\ No newline at end of file
+});
diff --git a/test/radar.html b/test/radar.html
index c071474..671767b 100644
--- a/test/radar.html
+++ b/test/radar.html
@@ -90,7 +90,12 @@ under the License.
value: ['-', 8000, 20000, 20000, 40000, 10000],
name: '第一个元素是 null'
}
- ]
+ ],
+ symbol: 'triangle',
+ symbolSize: 20,
+ symbolRotate: function(value, params) {
+ return ~~(360 * Math.random());
+ }
}]
});
var theIndex = 2;
@@ -110,4 +115,4 @@ under the License.
</script>
</body>
-</html>
\ No newline at end of file
+</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org