把下面代码蓝色和绿色的样式改为淡蓝色和淡绿色thisdefineload5 function o2loadechartUrl function 基于准备好的dom初始化echarts实例 var myDue = echartsinitdocumentgetElementByIddue; 指定图表的配置项和数据 option = title
this.define("load5", function () { o2.load(echartUrl, function () { // 基于准备好的dom,初始化echarts实例 var myDue = echarts.init(document.getElementById('due'));
// 指定图表的配置项和数据
option = {
title: {
text: '当月投诉反馈处理率'
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)' // 显示比例
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: '投诉反馈处理率',
type: 'pie',
radius: ['30%', '70%'],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 10,
borderColor: '#fff',
borderWidth: 2
},
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 45, name: '处理', itemStyle: { color: 'lightblue' } },
{ value: 5, name: '未处理', itemStyle: { color: 'lightgreen' } },
{
label: {
show: false
}
}
]
}
]
};
// 使用刚指定的配置项和数据显示图表。
myDue.setOption(option);
}.bind(this)); })
原文地址: https://www.cveoy.top/t/topic/ihK1 著作权归作者所有。请勿转载和采集!