changed days of the week to actual dates

master
Adriel Sand 2021-10-01 13:01:33 +03:00
parent 0dc57b2e6b
commit 9ee47146db
1 changed files with 18 additions and 15 deletions

View File

@ -76,28 +76,31 @@
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script> <script>
const labels = [ const labels = [
'Sunday', 'day_date_1',
'Monday', 'day_date_2',
'Tuesday', 'day_date_3',
'Wednesday', 'day_date_4',
'Thursday', 'day_date_5',
'Friday', 'day_date_6',
'Saturday', 'day_date_7',
]; ];
const data = { const data = {
labels: labels, labels: labels,
datasets: [{ datasets: [
{
label: 'Hours we had electricity from government', label: 'Hours we had electricity from government',
backgroundColor: 'rgb(255, 99, 132)', backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)', borderColor: 'rgb(255, 99, 132)',
data: [offtime_1, offtime_2, offtime_3, offtime_4, offtime_5, offtime_6, offtime_7], data: [offtime_1, offtime_2, offtime_3, offtime_4, offtime_5, offtime_6, offtime_7],
fill: { fill: true,
target: 'origin', // fill: {
above: 'rgb(255, 0, 0)', // Area will be red above the origin // target: 'origin',
below: 'rgb(0, 0, 255)' // And blue below the origin // above: 'rgb(255, 0, 0)', // Area will be red above the origin
// below: 'rgb(0, 0, 255)' // And blue below the origin
}, //
}] // },
},
]
}; };
const config = { const config = {
type: 'line', type: 'line',