优化资金
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { to } from 'await-to-js';
|
||||
import * as echarts from 'echarts/core';
|
||||
import { text } from 'stream/consumers';
|
||||
// import { PictorialBarChart } from 'echarts/charts'
|
||||
@ -255,7 +256,6 @@ export const getLineOption = (lineData: any) => {
|
||||
const maxData = Math.max(...lineData.line1.flat());
|
||||
|
||||
const option = {
|
||||
|
||||
backgroundColor: '',
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
@ -313,7 +313,7 @@ export const getLineOption = (lineData: any) => {
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
@ -698,7 +698,7 @@ export const getBarOptions = (data: any) => {
|
||||
const option = {
|
||||
backgroundColor: '',
|
||||
grid: {
|
||||
left: '8%',
|
||||
left: '9%',
|
||||
top: '10%', // 顶部留一点空间给 legend
|
||||
bottom: '8%',
|
||||
right: '2%'
|
||||
@ -716,7 +716,8 @@ export const getBarOptions = (data: any) => {
|
||||
formatter: (params: any) => {
|
||||
// params 是数组,对应每条柱子
|
||||
return params
|
||||
.map((p: any) => `${p.seriesName}:${p.value} 万元`)
|
||||
.map((p: any) => `${p.seriesName}:${Number(p.value).toFixed(2)} 万元`)
|
||||
|
||||
.join('<br/>');
|
||||
},
|
||||
textStyle: {
|
||||
@ -758,8 +759,11 @@ export const getBarOptions = (data: any) => {
|
||||
{
|
||||
axisLabel: {
|
||||
formatter: function (value) {
|
||||
value = value + '万';
|
||||
return value;
|
||||
if (value >= 1000) {
|
||||
return value / 1000 + '千万';
|
||||
} else {
|
||||
return value + '万';
|
||||
}
|
||||
},
|
||||
color: 'rgba(255, 255, 255, 0.8)'
|
||||
},
|
||||
@ -825,7 +829,9 @@ export const getBarOptions = (data: any) => {
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
formatter: '{c}',
|
||||
formatter: function (params) {
|
||||
return Number(params.value).toFixed(2);
|
||||
},
|
||||
position: 'top',
|
||||
color: '#fff',
|
||||
fontSize: 10
|
||||
@ -864,11 +870,12 @@ export const getBarOptions = (data: any) => {
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
formatter: '{c}',
|
||||
formatter: function (params) {
|
||||
return Number(params.value).toFixed(2);
|
||||
},
|
||||
position: 'top',
|
||||
color: '#fff',
|
||||
fontSize: 10,
|
||||
padding: 5
|
||||
fontSize: 10
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -898,7 +905,6 @@ export const getBarOptions2 = (data: any) => {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
show: true
|
||||
|
||||
},
|
||||
legend: {
|
||||
top: '5%',
|
||||
@ -929,10 +935,10 @@ export const getBarOptions2 = (data: any) => {
|
||||
{ value: 3, name: '100万以下' },
|
||||
{ value: 4, name: '100-500万' },
|
||||
{ value: 5, name: '500-1000万' },
|
||||
{ value: 4, name: '1000万以上' },
|
||||
{ value: 4, name: '1000万以上' }
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
return option;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user