refactoring

This commit is contained in:
frankknoll
2023-01-28 16:31:41 +01:00
parent b797d210c5
commit 70f213978d
2 changed files with 7 additions and 12 deletions

View File

@@ -3,13 +3,15 @@ class HistogramView {
constructor() {
}
show(batchcode, div) {
show(batchcode, uiContainer) {
fetch(`data/histograms/${batchcode}.json`)
.then(response => response.json())
.then(json => {
const data = json.histograms[3].histogram;
const canvas = document.createElement("canvas");
uiContainer.appendChild(canvas);
new Chart(
div.querySelector('#symptomByBatchcodeHisto'),
canvas,
{
type: 'bar',
data: {