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/07/05 10:09:59 UTC

[GitHub] wupengFEX opened a new issue #8653: echarts在定义colors的前提下如何自动根据这些颜色设置渐变

wupengFEX opened a new issue #8653: echarts在定义colors的前提下如何自动根据这些颜色设置渐变
URL: https://github.com/apache/incubator-echarts/issues/8653
 
 
   ### One-line summary [问题简述]
   目前我在自定义 echarts 模版,遇到的问题是在定义了全局 colors 的情况下无法让图表根据选中的颜色(colors 中的)设置渐变(渐变的位置可以自定义),官方示例提供的都是自定义颜色来生成的渐变,如:
   ```
   {
           "color": [
               "#c23531",
               "#2f4554",
               "#61a0a8",
               "#d48265",
               "#91c7ae",
               "#749f83",
               "#ca8622",
               "#bda29a",
               "#6e7074",
               "#546570",
               "#c4ccd3"
           ],
         "line": {
               itemStyle: {
               normal: {
                   color: new echarts.graphic.LinearGradient(
                       0, 0, 0, 1,
                       [
                           {offset: 0, color: '#83bff6'},
                           {offset: 0.5, color: '#188df0'},
                           {offset: 1, color: '#188df0'}
                       ]
                   )
               }
           }
       }
   }
   ```
   请问如何在不需要手动设置颜色(echarts从colors里面自动提取)的情况下设置渐变?

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