|
@@ -74,8 +74,8 @@ export default {
|
|
const legend = []
|
|
const legend = []
|
|
if (bit) {
|
|
if (bit) {
|
|
data.map(item => {
|
|
data.map(item => {
|
|
- const p = `${item.name}: ${item.value}${bit}`
|
|
|
|
- legend.push(p)
|
|
|
|
|
|
+ const p = `${item.name}: ${item.value}${bit}`
|
|
|
|
+ legend.push(p)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
const option = {
|
|
const option = {
|
|
@@ -94,21 +94,21 @@ export default {
|
|
formatter: `{b} : {d}%`
|
|
formatter: `{b} : {d}%`
|
|
},
|
|
},
|
|
legend: {
|
|
legend: {
|
|
- orient: 'horizontal',
|
|
|
|
- left: 'center',
|
|
|
|
- bottom: '5',
|
|
|
|
- padding: 5,
|
|
|
|
- textStyle: {
|
|
|
|
- color: '#abd7ff',
|
|
|
|
|
|
+ orient: 'horizontal',
|
|
|
|
+ left: 'center',
|
|
|
|
+ bottom: '5',
|
|
|
|
+ padding: 5,
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: '#abd7ff',
|
|
fontSize: 10
|
|
fontSize: 10
|
|
- },
|
|
|
|
- show: !!bit,
|
|
|
|
- formatter: function (name) {
|
|
|
|
- if (bit) {
|
|
|
|
|
|
+ },
|
|
|
|
+ show: !!bit,
|
|
|
|
+ formatter: function (name) {
|
|
|
|
+ if (bit) {
|
|
const p = data.find(item => item.name == name)
|
|
const p = data.find(item => item.name == name)
|
|
return name + (p ? (':' + p.value + bit) : '')
|
|
return name + (p ? (':' + p.value + bit) : '')
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
series: [{
|
|
series: [{
|
|
type: 'pie',
|
|
type: 'pie',
|
|
@@ -120,8 +120,7 @@ export default {
|
|
normal: {
|
|
normal: {
|
|
formatter: params => {
|
|
formatter: params => {
|
|
return (
|
|
return (
|
|
- '{name|' + params.name + '}{value|' +
|
|
|
|
- params.percent + '%' + '}'
|
|
|
|
|
|
+ '{name|' + params.name + '}{value|' + params.percent + '%' + '}'
|
|
)
|
|
)
|
|
},
|
|
},
|
|
padding: [0, -70, 25, -70],
|
|
padding: [0, -70, 25, -70],
|
|
@@ -226,7 +225,7 @@ export default {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- const con5 = document.getElementById('con1')
|
|
|
|
|
|
+ const con1 = document.getElementById('con1')
|
|
const chart1 = echarts.init(con1)
|
|
const chart1 = echarts.init(con1)
|
|
const option = this.initPie(chart1, '', this.pieData)
|
|
const option = this.initPie(chart1, '', this.pieData)
|
|
chart1.setOption(option)
|
|
chart1.setOption(option)
|