commit 28751396962450c9f77b69883c7f0e4ccc32a7bc
parent 14819e391e448726c398b86fee1020ac827442f1
Author: Kninteman <[email protected]>
Date: Fri, 16 Jun 2023 16:45:55 +0200
Distinct colours, lines thicker and smoother
Diffstat:
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/js/panda.js b/js/panda.js
@@ -54,22 +54,24 @@ var myChart = new Chart(ctx, {
data: [],
backgroundColor: 'rgba(176, 204, 207, 1)',
borderColor: 'rgba(176, 204, 207, 1)',
- borderWidth: 2,
+ borderWidth: 5,
pointBackgroundColor: [],
pointBorderColor: [],
pointBorderWidth: [],
- pointRadius: 5
+ pointRadius: 5,
+ lineTension: 0.3
},
{
label: 'Chengdu Research Facility 2',
data: [],
- backgroundColor: 'rgba(195, 176, 207, 1)',
- borderColor: 'rgba(195, 176, 207, 1)',
- borderWidth: 2,
+ backgroundColor: 'rgba(176, 145, 207, 1)',
+ borderColor: 'rgba(176, 145, 207, 1)',
+ borderWidth: 5,
pointBackgroundColor: [],
pointBorderColor: [],
pointBorderWidth: [],
- pointRadius: 5
+ pointRadius: 5,
+ lineTension: 0.3
}
]
},
@@ -143,8 +145,8 @@ function fetchDataAndUpdateChart() {
myChart.data.datasets[0].pointBorderWidth = chengduHumidity.map(value => value > 80 ? 10 : 2);
myChart.data.datasets[0].data = chengduHumidity;
- myChart.data.datasets[1].pointBackgroundColor = kangdingHumidity.map(value => value > 80 ? 'rgba(207, 72, 72, 1)' : 'rgba(195, 176, 207, 1)');
- myChart.data.datasets[1].pointBorderColor = kangdingHumidity.map(value => value > 80 ? 'rgba(207, 72, 72, 1)' : 'rgba(195, 176, 207, 1)');
+ myChart.data.datasets[1].pointBackgroundColor = kangdingHumidity.map(value => value > 80 ? 'rgba(207, 72, 72, 1)' : 'rgba(176, 145, 207, 1)');
+ myChart.data.datasets[1].pointBorderColor = kangdingHumidity.map(value => value > 80 ? 'rgba(207, 72, 72, 1)' : 'rgba(176, 145, 207, 1)');
myChart.data.datasets[1].pointBorderWidth = kangdingHumidity.map(value => value > 80 ? 10 : 2);
myChart.data.datasets[1].data = kangdingHumidity;