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/11/04 13:54:34 UTC

[GitHub] 100pah closed pull request #9171: fix #8009 & #5969, symbol symbolSize and opacity setting for category itemStyle in graph

100pah closed pull request #9171: fix #8009 & #5969, symbol symbolSize and opacity setting for category itemStyle in graph
URL: https://github.com/apache/incubator-echarts/pull/9171
 
 
   

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/categoryVisual.js b/src/chart/graph/categoryVisual.js
index e7e318f53..00c54f968 100644
--- a/src/chart/graph/categoryVisual.js
+++ b/src/chart/graph/categoryVisual.js
@@ -31,11 +31,19 @@ export default function (ecModel) {
             var name = categoriesData.getName(idx);
             // Add prefix to avoid conflict with Object.prototype.
             categoryNameIdxMap['ec-' + name] = idx;
-
             var itemModel = categoriesData.getItemModel(idx);
+
             var color = itemModel.get('itemStyle.color')
                 || seriesModel.getColorFromPalette(name, paletteScope);
             categoriesData.setItemVisual(idx, 'color', color);
+
+            var itemStyleList = ['opacity', 'symbol', 'symbolSize', 'symbolKeepAspect'];
+            for (var i = 0; i < itemStyleList.length; i++) {
+                var itemStyle = itemModel.getShallow(itemStyleList[i], true);
+                if (itemStyle != null) {
+                    categoriesData.setItemVisual(idx, itemStyleList[i], itemStyle);
+                }
+            }
         });
 
         // Assign category color to visual
@@ -47,14 +55,19 @@ export default function (ecModel) {
                     if (typeof category === 'string') {
                         category = categoryNameIdxMap['ec-' + category];
                     }
-                    if (!data.getItemVisual(idx, 'color', true)) {
-                        data.setItemVisual(
-                            idx, 'color',
-                            categoriesData.getItemVisual(category, 'color')
-                        );
+
+                    var itemStyleList = ['color', 'opacity', 'symbol', 'symbolSize', 'symbolKeepAspect'];
+
+                    for (var i = 0; i < itemStyleList.length; i++) {
+                        if (data.getItemVisual(idx, itemStyleList[i], true) == null) {
+                            data.setItemVisual(
+                                idx, itemStyleList[i],
+                                categoriesData.getItemVisual(category, itemStyleList[i])
+                            );
+                        }
                     }
                 }
             });
         }
     });
-}
\ 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