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/03 02:07:24 UTC

[incubator-echarts] branch master updated: fix(markPoint): symbolRotate for markPoint does not work.

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 9b793bc  fix(markPoint): symbolRotate for markPoint does not work.
     new 19711a2  Merge pull request #12737 from plainheart/fix-12731
9b793bc is described below

commit 9b793bcd1960c218fad11b2ac142b3a628872c30
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Tue Jun 2 21:40:22 2020 +0800

    fix(markPoint): symbolRotate for markPoint does not work.
---
 src/component/marker/MarkPointView.js |  8 +++++++-
 test/markPoint.html                   | 11 ++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/component/marker/MarkPointView.js b/src/component/marker/MarkPointView.js
index 2edd302..fcb8944 100644
--- a/src/component/marker/MarkPointView.js
+++ b/src/component/marker/MarkPointView.js
@@ -104,10 +104,12 @@ export default MarkerView.extend({
             var itemModel = mpData.getItemModel(idx);
             var symbol = itemModel.getShallow('symbol');
             var symbolSize = itemModel.getShallow('symbolSize');
+            var symbolRotate = itemModel.getShallow('symbolRotate');
             var isFnSymbol = zrUtil.isFunction(symbol);
             var isFnSymbolSize = zrUtil.isFunction(symbolSize);
+            var isFnSymbolRotate = zrUtil.isFunction(symbolRotate);
 
-            if (isFnSymbol || isFnSymbolSize) {
+            if (isFnSymbol || isFnSymbolSize || isFnSymbolRotate) {
                 var rawIdx = mpModel.getRawValue(idx);
                 var dataParams = mpModel.getDataParams(idx);
                 if (isFnSymbol) {
@@ -117,11 +119,15 @@ export default MarkerView.extend({
                     // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?
                     symbolSize = symbolSize(rawIdx, dataParams);
                 }
+                if (isFnSymbolRotate) {
+                    symbolRotate = symbolRotate(rawIdx, dataParams);
+                }
             }
 
             mpData.setItemVisual(idx, {
                 symbol: symbol,
                 symbolSize: symbolSize,
+                symbolRotate: symbolRotate,
                 color: itemModel.get('itemStyle.color')
                     || seriesData.getVisual('color')
             });
diff --git a/test/markPoint.html b/test/markPoint.html
index abd4081..60e03d1 100644
--- a/test/markPoint.html
+++ b/test/markPoint.html
@@ -144,9 +144,14 @@ under the License.
                                     {
                                         name: '平均值stack',
                                         type: 'average',
-                                        value: 1
+                                        value: 1,
+                                        // 覆盖series配置的symbolRotate
+                                        symbolRotate: 45
                                     }
-                                ]
+                                ],
+                                symbolRotate: function(value, params) {
+                                    return ~~(Math.random() * 360);
+                                }
                             }
                         },
                         {
@@ -219,4 +224,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