diff --git a/static/js/weather-chart.js b/static/js/weather-chart.js index 0521079..8cc74ea 100644 --- a/static/js/weather-chart.js +++ b/static/js/weather-chart.js @@ -153,6 +153,17 @@ const WeatherChart = { responsive: true, maintainAspectRatio: false, interaction: { mode: 'index', intersect: false }, + layout: { padding: { top: 12, right: 16, bottom: 12, left: 16 } }, + plugins: { + legend: { + display: true, + position: 'top', + align: 'center', + labels: { + padding: 16 + } + } + }, scales: { '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 },