Revert "feat: 优化前端页面"
This reverts commit 7e24cc52c9c380194fa7a480cb11dead2c5e6bb7.
This commit is contained in:
parent
7e24cc52c9
commit
781a93cefc
@ -87,8 +87,7 @@ const WeatherChart = {
|
|||||||
backgroundColor: 'rgba(255, 99, 132, 0.1)',
|
backgroundColor: 'rgba(255, 99, 132, 0.1)',
|
||||||
yAxisID: 'y-temperature',
|
yAxisID: 'y-temperature',
|
||||||
tension: 0.4,
|
tension: 0.4,
|
||||||
spanGaps: false,
|
spanGaps: false
|
||||||
legendGroup: 'history'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '湿度 (%) - 实测',
|
label: '湿度 (%) - 实测',
|
||||||
@ -98,8 +97,7 @@ const WeatherChart = {
|
|||||||
yAxisID: 'y-humidity',
|
yAxisID: 'y-humidity',
|
||||||
tension: 0.4,
|
tension: 0.4,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
spanGaps: false,
|
spanGaps: false
|
||||||
legendGroup: 'history'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '雨量 (mm) - 实测',
|
label: '雨量 (mm) - 实测',
|
||||||
@ -107,8 +105,7 @@ const WeatherChart = {
|
|||||||
type: 'bar',
|
type: 'bar',
|
||||||
backgroundColor: 'rgba(54, 162, 235, 0.6)',
|
backgroundColor: 'rgba(54, 162, 235, 0.6)',
|
||||||
borderColor: 'rgb(54, 162, 235)',
|
borderColor: 'rgb(54, 162, 235)',
|
||||||
yAxisID: 'y-rainfall',
|
yAxisID: 'y-rainfall'
|
||||||
legendGroup: 'history'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '累计雨量 (mm) - 实测',
|
label: '累计雨量 (mm) - 实测',
|
||||||
@ -119,17 +116,16 @@ const WeatherChart = {
|
|||||||
tension: 0.2,
|
tension: 0.2,
|
||||||
spanGaps: false,
|
spanGaps: false,
|
||||||
pointRadius: 0,
|
pointRadius: 0,
|
||||||
hidden: true,
|
hidden: true
|
||||||
legendGroup: 'history'
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
if (forecastData.length > 0) {
|
if (forecastData.length > 0) {
|
||||||
// 雨量 仅显示 -1h/-2h/-3h
|
// 雨量 仅显示 -1h/-2h/-3h
|
||||||
datasets.push(
|
datasets.push(
|
||||||
{ label: '雨量 (mm) - 预报 (+1h)', data: forecastRainfallsH1, type: 'bar', backgroundColor: 'rgba(255, 99, 71, 0.55)', borderColor: 'rgb(255, 99, 71)', yAxisID: 'y-rainfall', legendGroup: 'forecast' },
|
{ label: '雨量 (mm) - 预报 (+1h)', data: forecastRainfallsH1, type: 'bar', backgroundColor: 'rgba(255, 99, 71, 0.55)', borderColor: 'rgb(255, 99, 71)', yAxisID: 'y-rainfall' },
|
||||||
{ label: '雨量 (mm) - 预报 (+2h)', data: forecastRainfallsH2, type: 'bar', backgroundColor: 'rgba(255, 205, 86, 0.55)', borderColor: 'rgb(255, 205, 86)', yAxisID: 'y-rainfall', legendGroup: 'forecast' },
|
{ label: '雨量 (mm) - 预报 (+2h)', data: forecastRainfallsH2, type: 'bar', backgroundColor: 'rgba(255, 205, 86, 0.55)', borderColor: 'rgb(255, 205, 86)', yAxisID: 'y-rainfall' },
|
||||||
{ label: '雨量 (mm) - 预报 (+3h)', data: forecastRainfallsH3, type: 'bar', backgroundColor: 'rgba(76, 175, 80, 0.55)', borderColor: 'rgb(76, 175, 80)', yAxisID: 'y-rainfall', legendGroup: 'forecast' }
|
{ label: '雨量 (mm) - 预报 (+3h)', data: forecastRainfallsH3, type: 'bar', backgroundColor: 'rgba(76, 175, 80, 0.55)', borderColor: 'rgb(76, 175, 80)', yAxisID: 'y-rainfall' }
|
||||||
);
|
);
|
||||||
|
|
||||||
// 温度 取最接近的预报(0h>1h>2h>3h)
|
// 温度 取最接近的预报(0h>1h>2h>3h)
|
||||||
@ -141,8 +137,7 @@ const WeatherChart = {
|
|||||||
borderDash: [5, 5],
|
borderDash: [5, 5],
|
||||||
yAxisID: 'y-temperature',
|
yAxisID: 'y-temperature',
|
||||||
tension: 0.4,
|
tension: 0.4,
|
||||||
spanGaps: false,
|
spanGaps: false
|
||||||
legendGroup: 'forecast'
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,20 +153,6 @@ const WeatherChart = {
|
|||||||
responsive: true,
|
responsive: true,
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
interaction: { mode: 'index', intersect: false },
|
interaction: { mode: 'index', intersect: false },
|
||||||
plugins: {
|
|
||||||
legend: {
|
|
||||||
position: 'top',
|
|
||||||
align: 'center',
|
|
||||||
labels: {
|
|
||||||
boxWidth: 30,
|
|
||||||
padding: 15,
|
|
||||||
font: {
|
|
||||||
size: 11
|
|
||||||
}
|
|
||||||
},
|
|
||||||
maxHeight: 80
|
|
||||||
}
|
|
||||||
},
|
|
||||||
scales: {
|
scales: {
|
||||||
'y-temperature': { type: 'linear', display: true, position: 'left', title: { display: true, text: '温度 (°C)' } },
|
'y-temperature': { type: 'linear', display: true, position: 'left', title: { display: true, text: '温度 (°C)' } },
|
||||||
'y-humidity': { type: 'linear', display: true, position: 'right', title: { display: true, text: '湿度 (%)' }, grid: { drawOnChartArea: false }, min: 0, max: 100 },
|
'y-humidity': { type: 'linear', display: true, position: 'right', title: { display: true, text: '湿度 (%)' }, grid: { drawOnChartArea: false }, min: 0, max: 100 },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user