echarts柱状图,改变柱状颜色

在使用echarts产生的柱状图中,有时候自动产生的颜色大不如人意,可以通过以下参数进行修改。

series : [
                            {
                                name:'天数',
                                type:'bar',
                                stack: '天',
                                data:[30, 45, 15,60,40],
                                barWidth: 30,
                                itemStyle:{
                                    normal:{
                                        color:'#4ad2ff'
                                    }
                                },
                                label:{ 
                                    normal:{ 
                                        show: true, 
                                        position: 'insideTop'} 
                                        }
                            }
                        ]

 

其中,

itemStyle:{
                                    normal:{
                                        color:'#4ad2ff'
                                    }
                                },

 

以上代码块,便可以修改柱状图颜色。

posted @ 2018-09-19 15:59  疯子110  阅读(3700)  评论(0编辑  收藏  举报