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/04/21 02:58:04 UTC

[GitHub] [incubator-echarts] susiwen8 opened a new pull request #12468: Fix: gauge chart legend color is incorrect

susiwen8 opened a new pull request #12468:
URL: https://github.com/apache/incubator-echarts/pull/12468


   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   Gauge series shouldn't itemStyle option at default
   
   
   
   ### Fixed issues
   
   Close #12376 
   
   
   ## Details
   
   ### Before: What was the problem?
   
   ![Screen Shot 2020-04-21 at 10 55 35](https://user-images.githubusercontent.com/20318608/79820475-e3608580-83be-11ea-873e-070347e0ff66.png)
   
   
   
   
   ### After: How is it fixed in this PR?
   
   ![Screen Shot 2020-04-21 at 10 55 52](https://user-images.githubusercontent.com/20318608/79820485-e9eefd00-83be-11ea-8b0a-24d159ac01b1.png)
   
   
   
   
   ## Usage
   
   ### Are there any API changes?
   
   - [ ] The API has been changed.
   
   <!-- LIST THE API CHANGES HERE -->
   
   
   
   ### Related test cases or examples to use the new APIs
   
   NA.
   
   
   
   ## Others
   
   ### Merging options
   
   - [x] Please squash the commits into a single one when merge.
   
   ### Other information
   


----------------------------------------------------------------
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


[GitHub] [incubator-echarts] pissang edited a comment on pull request #12468: Fix: gauge chart legend color is incorrect

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on pull request #12468:
URL: https://github.com/apache/incubator-echarts/pull/12468#issuecomment-668499728


   I think it's better to encode the color in the visual so legend can access it.
   
   Current change is too tricky and may cause unexpected issues in the further. For example, this `#000` color may be given by the `visualMap` component. In this case `itemStyleModel.get('color')` is also null.
   
   If you don't mind, you may refact it in the next branch


----------------------------------------------------------------
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


[GitHub] [incubator-echarts] echarts-bot[bot] commented on issue #12468: Fix: gauge chart legend color is incorrect

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #12468:
URL: https://github.com/apache/incubator-echarts/pull/12468#issuecomment-616921733


   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/incubator-echarts/wiki/How-to-make-a-pull-request).


----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
pissang commented on pull request #12468:
URL: https://github.com/apache/incubator-echarts/pull/12468#issuecomment-668499728


   I think it's better to encode the color in the visual so legend can access it.
   
   Current change is too tricky and may cause unexpected issues in the further. For example, this #000 color may be given by the `visualMap` component. In this case `itemStyleModel.get('color')` is also null.
   


----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [incubator-echarts] pissang edited a comment on pull request #12468: Fix: gauge chart legend color is incorrect

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on pull request #12468:
URL: https://github.com/apache/incubator-echarts/pull/12468#issuecomment-668499728


   I think it's better to encode the color in the visual so legend can access it.
   
   Current change is too tricky and may cause unexpected issues in the further. For example, this `#000` color may be given by the `visualMap` component. In this case `itemStyleModel.get('color')` is also null.
   


----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
susiwen8 commented on a change in pull request #12468:
URL: https://github.com/apache/incubator-echarts/pull/12468#discussion_r443119110



##########
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:
       Yes, you are right, I have added this judgement.




----------------------------------------------------------------
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