如何给eCharts饼图区域指定颜色

原文:http://www.itdaan.com/blog/source/6276d6a2456bd788e44eacebe0de17df.html

在option中增加属性color,并指定几种颜色,此颜色将根据饼图的区域个数循环,代码段如下:

option = {
        title : {
        text: '全局指标状态分布图',
               x:'left',
               y:'top'
        },
        tooltip : {
               show: true,
               formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        color:['red', 'green','yellow','blueviolet']
}

运行效果如图所示:

猜你喜欢

转载自blog.csdn.net/qq_37960324/article/details/82830841