v-chart 渐变色

<ve-line
      :colors="colors"
      :data="chartData"
      :settings="chartSettings"
      :data-zoom="dataZoom"
    ></ve-line>
 
import echarts from 'echarts'
 
this.colors = [
      new echarts.graphic.LinearGradient(
          0,0,0,1,[{
          offset: 0, color: 'rgba(65,95,255,1)'
        },{
          offset: 1, color: 'rgba(65,95,255,0)'
        }]),
        new echarts.graphic.LinearGradient(
          0,0,0,1,[{
          offset: 0, color: 'rgba(234,79,63,1)'
        },{
          offset: 1, color: 'rgba(234,79,63, 0)'
        }]),
        new echarts.graphic.LinearGradient(
          0,0,0,1,[{
          offset: 0, color: 'rgba(49,209,136,1)'
        },{
          offset: 1, color: 'rgba(49,209,136,0)'
        }]),
        new echarts.graphic.LinearGradient(
          0,0,0,1,[{
          offset: 0, color: 'rgba(255,149,54,1)'
        },{
          offset: 1, color: 'rgba(255,149,54,0)'
        }]),
        new echarts.graphic.LinearGradient(
          0,0,0,1,[{
          offset: 0, color: 'rgba(176,214,221,1)'
        },{
          offset: 1, color: 'rgba(176,214,221,0)'
        }]),
        new echarts.graphic.LinearGradient(
          0,0,0,1,[{
          offset: 0, color: 'rgba(248,231,28,1)'
        },{
          offset: 1, color: 'rgba(248,231,28,0)'
        }]
      )
    ]
原文地址:https://www.cnblogs.com/MJmajong/p/12983522.html