eacharts图颜色随机变化和定制颜色

        itemStyle: {
            normal: {
                // 随机显示
                color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);}
                // 定制显示(按顺序)
                // color: function(params) { 
                //     var colorList = ['#C33531','#EFE42A','#64BD3D','#EE9201','#29AAE3', '#B74AE5','#0AAF9F','#E89589','#16A085','#4A235A','#C39BD3 ','#F9E79F','#BA4A00','#ECF0F1','#616A6B','#EAF2F8','#4A235A','#3498DB' ]; 
                //     return colorList[params.dataIndex] 
                // }
            },
        },  

 

posted @ 2021-09-17 15:19  _Lawrence  阅读(182)  评论(0编辑  收藏  举报