[修改] 修改统计图问题

This commit is contained in:
lijiarao
2022-10-21 18:33:44 +08:00
parent 34ca17da1d
commit 4ab91f1708
3 changed files with 16 additions and 13 deletions
+1
View File
@@ -1,4 +1,5 @@
export function formatMoney(money) {
if(money === '') return ''
var num = (money || 0).toString(),
re = /\d{3}$/,
result = ''
+10 -9
View File
@@ -171,7 +171,7 @@ export default {
dataSource.map((item, index) => {
let dataIndex = 'key' + index
tableData[0][dataIndex] = item.money
tableData[1][dataIndex] = item.value + '%'
tableData[1][dataIndex] = item.value ? item.value +'%' :''
})
this.dataSource = tableData
}
@@ -250,6 +250,7 @@ export default {
* 处理表头
* */
initColumns(data) {
const newData = data.slice(0,5)
this.columns = [
{
title: '',
@@ -259,7 +260,7 @@ export default {
scopedSlots: {customRender: 'text'}
},
]
data.map((item, index) => {
newData.map((item, index) => {
this.columns.push({
title: item.name_dictText,
align: 'center',
@@ -268,13 +269,13 @@ export default {
scopedSlots: {customRender: 'allMoney'}
},)
})
// this.columns.push( {
// title: '总数',
// align: 'center',
// width: 70,
// dataIndex: 'allMoney',
// scopedSlots: {customRender: 'text'}
// },)
this.columns.push( {
title: '总数',
align: 'center',
width: 70,
dataIndex: 'key5',
scopedSlots: {customRender: 'allMoney'}
},)
},
// 处理圆点
initPoint(data, color) {
+5 -4
View File
@@ -177,7 +177,7 @@ export default {
let color = ['#069F99', '#88C87E ', '#6D7FD0', '#FA9D81', '#A5B3FF']
let echartsData = data.reduce((pre, val) => {
return pre.concat({value: val.money, name: val.name, money: val.money})
}, [])
}, []).slice(0,4)
echartsData = this.initPoint(echartsData, color)
let chartDom = document.getElementById('notReceived')
let myChart = echarts.init(chartDom)
@@ -198,10 +198,11 @@ export default {
}
},
legend: {
left:'15%',
bottom: '2%',
right: '5%',
padding: [0, 80, 0, 80],
itemGap:75
right: '2%',
padding: [0, 50, 0, 50],
itemGap:50
},
labelLine: {
lineStyle: {