Files
HowBadIsMyBatch/docs/HistogramView.js
frankknoll b797d210c5 refactoring
2023-01-28 16:18:19 +01:00

25 lines
715 B
JavaScript

class HistogramView {
constructor() {
}
show(batchcode, div) {
fetch(`data/histograms/${batchcode}.json`)
.then(response => response.json())
.then(json => {
const data = json.histograms[3].histogram;
new Chart(
div.querySelector('#symptomByBatchcodeHisto'),
{
type: 'bar',
data: {
datasets: [{
label: 'Acquisitions by year',
data: data
}]
}
}
);
});
}
}