422
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
return {
|
||||
...item,
|
||||
value: item.occupiedSpaces,
|
||||
total: item.total,
|
||||
itemStyle: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
@@ -62,6 +63,7 @@
|
||||
return {
|
||||
...item,
|
||||
value: item.occupiedSpaces,
|
||||
total: item.total,
|
||||
itemStyle: {
|
||||
color: '#fff',
|
||||
opacity: 1
|
||||
@@ -70,7 +72,9 @@
|
||||
})
|
||||
}
|
||||
const getYAxisData = () => {
|
||||
return props.list.map((item) => item.occupiedSpaces)
|
||||
return props.list.map((item) => {
|
||||
return{value:item.occupiedSpaces,total:item.total}
|
||||
})
|
||||
}
|
||||
const init = () => {
|
||||
if (!params) {
|
||||
@@ -129,7 +133,8 @@
|
||||
padding: [0, 0, 6, 0],
|
||||
inside: true,
|
||||
formatter: function (value) {
|
||||
return `{value|余}{value|${value}}`
|
||||
let obj = props.list.find((item) => item.occupiedSpaces == value)
|
||||
return `{value|余}{value|${value}}/{total|总}{total|${obj?.total}}`
|
||||
},
|
||||
rich: {
|
||||
value: {
|
||||
@@ -137,7 +142,13 @@
|
||||
color: '#fff',
|
||||
fontWeight: 600,
|
||||
fontSize: fitChartSize(14)
|
||||
}
|
||||
},
|
||||
total: {
|
||||
align: 'center',
|
||||
color: '#fff',
|
||||
fontWeight: 600,
|
||||
fontSize: fitChartSize(14)
|
||||
},
|
||||
}
|
||||
},
|
||||
data: getYAxisData()
|
||||
|
||||
Reference in New Issue
Block a user