xy 2 years ago
parent 67d7b9841f
commit b043a1e2c6

@ -360,17 +360,18 @@
] ]
}) })
var pieChart = echarts.init(document.querySelector("#pie-chart")); var pieChart = echarts.init(document.querySelector("#pie-chart"));
var pieWidthPer = 100 / lies.length; var pieRows = Math.ceil(lies.length / 3);
var option = { var option = {
series: datas.map(function (data, idx) { series: datas.map(function (data, idx) {
var left = idx * pieWidthPer; var left = idx * 33.3;
var top = Math.floor(idx / 3) * (100 / pieRows)
return { return {
type: 'pie', type: 'pie',
radius: [40, 60], radius: [40, 60],
top: 'center', top: top + "%",
height: '33.33%', height: (100 / pieRows) + "%",
left: left + '%', left: left + '%',
width: pieWidthPer + '%', width: '33.33%',
itemStyle: { itemStyle: {
borderColor: '#fff', borderColor: '#fff',
borderWidth: 1 borderWidth: 1

Loading…
Cancel
Save