From 2d5a36c230bd0da70a9a2a2c81ce3772a1bf8b74 Mon Sep 17 00:00:00 2001 From: frankknoll Date: Sat, 28 Jan 2023 23:19:55 +0100 Subject: [PATCH] refactoring --- docs/HistogramView.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/HistogramView.js b/docs/HistogramView.js index 4d33bdd5706..fe2336a4a2c 100644 --- a/docs/HistogramView.js +++ b/docs/HistogramView.js @@ -24,15 +24,14 @@ class HistogramView { #displayHistograms(histoDescrs) { for (const histoDescr of histoDescrs.histograms) { - const canvas = document.createElement("canvas"); - this.#uiContainer.appendChild(canvas); - this.#displayHistogram(histoDescr, canvas); + this.#uiContainer.appendChild(this.#createHistogram(histoDescr).canvas); } } - #displayHistogram(histoDescr, canvas) { + #createHistogram(histoDescr) { // FK-TODO: brauchen Slider wie bei intensivstationen - new Chart( + const canvas = document.createElement("canvas"); + return new Chart( canvas, { type: 'bar',