Vvvickie commented on a change in 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#discussion_r224379592
 
 

 ##########
 File path: src/chart/graph/categoryVisual.js
 ##########
 @@ -36,32 +36,19 @@ export default function (ecModel) {
             var color = itemModel.get('itemStyle.color')
                 || seriesModel.getColorFromPalette(name, paletteScope);
             categoriesData.setItemVisual(idx, 'color', color);
+
             var opacity = itemModel.get('itemStyle.opacity') || 1;
             categoriesData.setItemVisual(idx, 'opacity', opacity);
-            var itemSymbolType = itemModel.getShallow('symbol', true);
-            if (itemSymbolType != null) {
-                categoriesData.setItemVisual(idx, 'symbol', itemSymbolType);
-            }
 
-            var itemSymbolSize = itemModel.getShallow('symbolSize', true);
-            if (itemSymbolSize != null) {
-                categoriesData.setItemVisual(idx, 'symbolSize', 
itemSymbolSize);
-            }
+            var symbolStyleList = 
['symbol','symbolSize','symbolKeepAspect','symbolOffset','symbolRotate']
 
-            var itemSymbolKeepAspect = 
itemModel.getShallow('symbolKeepAspect',true);
-            if (itemSymbolKeepAspect != null) {
-                categoriesData.setItemVisual(idx, 'symbolKeepAspect', 
itemSymbolKeepAspect);
-            }
-
-            var itemSymbolOffset = itemModel.getShallow('symbolOffset',true);
-            if (itemSymbolOffset != null) {
-                categoriesData.setItemVisual(idx, 'symbolOffset', 
itemSymbolOffset);
+            for(var i = 0;i < symbolStyleList.length;i++){
+                var symbolStyleItem = itemModel.getShallow(symbolStyleList[i], 
true);
 
 Review comment:
   Both symbolOffset and other items return undefined, but somehow it works. I 
have checked that it can be consoled during the upper section.
   ```
   for (var i = 0; i < symbolStyleList.length; i++) {
                   var symbolStyleItem = 
itemModel.getShallow(symbolStyleList[i], true);
                   if (symbolStyleItem != null) {
                       categoriesData.setItemVisual(idx, symbolStyleList[i], 
symbolStyleItem);
                   }
               }
   ```
   In my local server, changing the symbolOffset do bring some effects to the 
symbol. You could put the percentage larger to see that. 
   But I am not sure whether the position is right since it is not computed by 
my code...
   Really really sorry for those mistakes I have made... 
   Here is a new version with formatted code.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to