|
@ -20,7 +20,10 @@ function setOption(chart, seriesData, xData) { |
|
|
}, |
|
|
}, |
|
|
xAxis: { |
|
|
xAxis: { |
|
|
type: 'category', |
|
|
type: 'category', |
|
|
data: xData |
|
|
data: xData, |
|
|
|
|
|
// axisLabel: {
|
|
|
|
|
|
// formatter: '{value}'
|
|
|
|
|
|
// }
|
|
|
}, |
|
|
}, |
|
|
yAxis: { |
|
|
yAxis: { |
|
|
type: 'value', |
|
|
type: 'value', |
|
@ -140,10 +143,28 @@ Page({ |
|
|
// const label = `${year}-${month}`;
|
|
|
// const label = `${year}-${month}`;
|
|
|
// xAxisLabels.push(label);
|
|
|
// xAxisLabels.push(label);
|
|
|
const nextMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + i, 1); |
|
|
const nextMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + i, 1); |
|
|
const month = nextMonth.toLocaleDateString('en-US', { |
|
|
const month = nextMonth |
|
|
month: 'short' |
|
|
.getMonth() |
|
|
}); // 获取月份的缩写
|
|
|
// .toLocaleDateString('en-US', {
|
|
|
xAxisLabels.push(month); |
|
|
// month: 'short'
|
|
|
|
|
|
// }); // 获取月份的缩写
|
|
|
|
|
|
|
|
|
|
|
|
const month_ = { |
|
|
|
|
|
"0": "Jan", |
|
|
|
|
|
"1": "Feb", |
|
|
|
|
|
"2": "Mar", |
|
|
|
|
|
"3": "Apr", |
|
|
|
|
|
"4": "May", |
|
|
|
|
|
"5": "Jun", |
|
|
|
|
|
"6": "Jul", |
|
|
|
|
|
"7": "Aug", |
|
|
|
|
|
"8": "Sep", |
|
|
|
|
|
"9": "Oct", |
|
|
|
|
|
"10": "Nov", |
|
|
|
|
|
"11": "Dec" |
|
|
|
|
|
}[month] |
|
|
|
|
|
console.log('月', month_); |
|
|
|
|
|
xAxisLabels.push(month_); |
|
|
} |
|
|
} |
|
|
//过期的
|
|
|
//过期的
|
|
|
const guaranteedRate = res.filter(item => moment(item.dateGuarantee).isBefore(moment()))?.length || 0 |
|
|
const guaranteedRate = res.filter(item => moment(item.dateGuarantee).isBefore(moment()))?.length || 0 |
|
|