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 2019/11/28 12:35:25 UTC

[GitHub] [incubator-echarts] 100pah edited a comment on issue #11736: [DISCUSS] How to choose color of legend when the color in series is a callback function

100pah edited a comment on issue #11736: [DISCUSS] How to choose color of legend when the color in series is a callback function
URL: https://github.com/apache/incubator-echarts/issues/11736#issuecomment-559477915
 
 
   A related test case: `test/line-style.html`.
   
   
   ## For line chart
   
   In this case:
   ```js
   itemStyle: {
       color: (param) => { /* return a color */ }
   },
   lineStyle: {
       color: 'blue'
   }
   ```
   The legend should better show 'blue', but neither palette color (since 4.5.0) nor the first symbol color (before 4.5.0).
   
   ## For scatter plot
   
   ```js
   itemStyle: {
       color: color: (param) => { /* return a color */ }
   }
   ```
   
   I modified it to use palette color (since 4.5.0) when callback exists. 
   That modification cause a break change from selecting the first symbol color.
   Use palette color is not a good solution, 
   so **the break change is not good and should not have happened**.
   
   About the better strategy, as @pissang mentioned, 
   I prefer:
   > Pick the median color from all colors returned by the callback function. It's a improved method of the original 'use first returned color' method.
   
   Or probably it's better to chose the most returned color, I think.
   
   ## Do we need to enable users to specify color to `legend component` directly?
   
   In case that the auto-calculated color is not what users expected.
   

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


With regards,
Apache Git Services

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