var option = {
legend: {
x: 'center',
y: 'center'
},
series: []
};
for (var i = 0; i < result.length; i++) {
var item = result[i];
var param = [
{ name: "other", value: item.other, total: item.score + item.other, itemStyle: labelBottom },
{ name: item.name, value: item.score, total: item.score + item.other, itemStyle: labelTop }
];
var pieParam = {
type: 'pie',
hoverAnimation: false,
radius: radius,
itemStyle: labelFromatter,
data: []
};
pieParam.x = (i * 20) + "%";
pieParam.center = [(i * 20) + 10 + "%", "30%"];
pieParam.data = param;
option.series.push(pieParam);
}
var qieChart = echarts.init(document.getElementById("picBox"));
qieChart.setOption(option);
}
echarts饼图间距
最新推荐文章于 2024-08-11 12:50:45 发布