You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/10/23 05:32:29 UTC

[GitHub] 100pah closed pull request #9210: fix #9182 Graph label.rotate is invalid

100pah closed pull request #9210: fix #9182 Graph    label.rotate is invalid
URL: https://github.com/apache/incubator-echarts/pull/9210
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/chart/graph/GraphView.js b/src/chart/graph/GraphView.js
index 4605420c0..01d6f745f 100644
--- a/src/chart/graph/GraphView.js
+++ b/src/chart/graph/GraphView.js
@@ -201,6 +201,8 @@ export default echarts.extendChartView({
         var cx = data.getLayout('cx');
         var cy = data.getLayout('cy');
         data.eachItemGraphicEl(function (el, idx) {
+            var itemModel = data.getItemModel(idx);
+            var labelRotate = itemModel.get('label.rotate') || 0;
             var symbolPath = el.getSymbolPath();
             if (circularRotateLabel) {
                 var pos = data.getItemLayout(idx);
@@ -222,7 +224,7 @@ export default echarts.extendChartView({
             }
             else {
                 symbolPath.setStyle({
-                    textRotation: 0
+                    textRotation: labelRotate *= Math.PI / 180
                 });
             }
         });
@@ -385,4 +387,4 @@ export default echarts.extendChartView({
         this._symbolDraw && this._symbolDraw.remove();
         this._lineDraw && this._lineDraw.remove();
     }
-});
\ No newline at end of file
+});


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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