xy 2 years ago
parent b043a1e2c6
commit 74b4badfa0

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

Loading…
Cancel
Save