|
|
|
@ -32,9 +32,10 @@ async function populateTimeseries(category) {
@@ -32,9 +32,10 @@ async function populateTimeseries(category) {
|
|
|
|
|
response.json().then(response => { |
|
|
|
|
const data = response.map(row => ({ |
|
|
|
|
x: row.sampling_date, |
|
|
|
|
y: parseInt(row.counts) |
|
|
|
|
y: parseInt(row.counts), |
|
|
|
|
details: row.details |
|
|
|
|
})); |
|
|
|
|
console.debug(data); |
|
|
|
|
console.debug(response); |
|
|
|
|
|
|
|
|
|
const chartOptions = { |
|
|
|
|
type: 'bar', |
|
|
|
@ -65,9 +66,20 @@ async function populateTimeseries(category) {
@@ -65,9 +66,20 @@ async function populateTimeseries(category) {
|
|
|
|
|
length: 4 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
plugins: { |
|
|
|
|
tooltip: { |
|
|
|
|
callbacks: { |
|
|
|
|
label: function(tooltipItems) { |
|
|
|
|
console.debug('adsfasdfasdf',tooltipItems); |
|
|
|
|
return tooltipItems.raw.details; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} }; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const ctx = document.getElementById(category + '-timeseries').getContext('2d'); |
|
|
|
|
new Chart(ctx, chartOptions); |
|
|
|
|