You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/06/20 09:51:14 UTC

[GitHub] [incubator-echarts] plainheart commented on a change in pull request #12468: Fix: gauge chart legend color is incorrect

plainheart commented on a change in pull request #12468:
URL: https://github.com/apache/incubator-echarts/pull/12468#discussion_r443117920



##########
File path: src/chart/gauge/GaugeView.js
##########
@@ -342,7 +342,7 @@ var GaugeView = ChartView.extend({
 
             pointer.useStyle(itemModel.getModel('itemStyle').getItemStyle());
 
-            if (pointer.style.fill === 'auto') {
+            if (pointer.style.fill === '#000') {

Review comment:
       If the user doesn't  specify `series.itemStyle.color`, there will be no problem.
   But if the user specifies `#000` for `series.itemStyle.color`, according to current logic, the color of pointer won't be `#000` but an automatic color, for example `#2f4554`. That seems to be unexpected, pointer color should be `#000` in fact. 
   So I think there may be missing a judgement about whether the user specifies `series.itemStyle.color`.
   ```js
   var itemStyleModel = itemModel.getModel('itemStyle');
   
   pointer.useStyle(itemStyleModel.getItemStyle());
   
   if (pointer.style.fill === '#000' && !itemStyleModel.get('color')) {
       pointer.setStyle('fill', getColor(
           linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true)
       ));
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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