refactoring

This commit is contained in:
frankknoll
2023-01-28 16:18:19 +01:00
parent 4875fd503b
commit b797d210c5
3 changed files with 28 additions and 19 deletions

25
docs/HistogramView.js Normal file
View File

@@ -0,0 +1,25 @@
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
}]
}
}
);
});
}
}