echarts histogram color gradient effect

For example, you want to change the gradient color histogram, you go inside to find series Series type - bar inside there and then modify the corresponding attribute, itemStyle (graphic style),

 

 

 series: [{
        name: 'threat' ,
        type: 'bar',
        barWidth:70,
        Data: [ 30,49,26, 60, 26 is],         // data 
        itemStyle: {
            normal: {
                color: new echarts.graphic.LinearGradient(
                    0, 0, 0, 1,
                    [
                        offset {: 0, Color: '# 06B5D7'},                    // column gradient FIG 
                        {offset: 0.5, Color: '# 44C0C1'},                  // column gradient FIG 
                        {offset: 1, color: ' # 71C8B1'} ,                    // bar graph gradient 
                    ]
                )
            },
            emphasis: {
                color: new echarts.graphic.LinearGradient(
                    0, 0, 0, 1,
                    [
                        offset {: 0, Color: '# 71C8B1'},                   // FIG gradient column highlight 
                        {offset: 0.7, Color: '# 44C0C1'},                 // FIG highlight column gradient 
                        {offset: 1, color: ' 06B5D7 # '}                    // FIG highlight gradient column 
                    ]
                )
            }
        },
    }]

 

Guess you like

Origin www.cnblogs.com/myfirstboke/p/11080968.html