diff --git a/docs/HistogramView.js b/docs/HistogramView.js index 51723ee5bb9..c6d8341747d 100644 --- a/docs/HistogramView.js +++ b/docs/HistogramView.js @@ -32,15 +32,35 @@ class HistogramView { #createHistogram(histoDescr) { // FK-TODO: brauchen Slider wie bei intensivstationen const canvas = document.createElement("canvas"); + const { 'keys': symptoms, 'values': frequencies } = Utils.getKeysAlignedWithValues(histoDescr.histogram); return new Chart( canvas, { type: 'bar', data: { + labels: symptoms, datasets: [{ label: histoDescr.batchcodes.join(', '), - data: histoDescr.histogram + data: frequencies }] + }, + options: { + indexAxis: 'y', + responsive: true, + scales: { + y: { + title: { + display: true, + text: 'Symptom' + } + }, + x: { + title: { + display: true, + text: 'Frequency' + } + } + }, } } ); diff --git a/docs/Utils.js b/docs/Utils.js index a1acab191aa..1a97fefe892 100644 --- a/docs/Utils.js +++ b/docs/Utils.js @@ -6,4 +6,14 @@ class Utils { const nums = [...arr].sort((a, b) => a - b); return arr.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2; } + + static getKeysAlignedWithValues(dict) { + const keys = []; + const values = []; + for (const [key, value] of Object.entries(dict)) { + keys.push(key); + values.push(value); + } + return { 'keys': keys, 'values': values }; + } } diff --git a/docs/batchCodeTable.html b/docs/batchCodeTable.html index f310eaed43a..ca88481b00a 100644 --- a/docs/batchCodeTable.html +++ b/docs/batchCodeTable.html @@ -1,18 +1,21 @@ + - - -Batch Codes of Coronavirus 2019 Vaccines - - - - - - - - - + + + + + + + -Fork me on GitHub -

Batch Codes of Coronavirus 2019 Vaccines

-

- -

-

-

-Check out your batch code (Last updated: January 20, 2023) + Fork me on GitHub +

Batch Codes of Coronavirus 2019 Vaccines

+

+

- - - - - - - - - - - - - - - -
BatchAdverse Reaction ReportsDeathsDisabilitiesLife Threatening IllnessesCompanyCountriesSevere reportsLethality
-

Data Source: -Vaccine Adverse Event Reporting System +

+

+ Check out your batch code (Last updated: January 20, 2023) +

+ + + + + + + + + + + + + + + +
BatchAdverse Reaction ReportsDeathsDisabilitiesLife Threatening IllnessesCompanyCountriesSevere reportsLethality
+

Data Source: + Vaccine Adverse Event Reporting System (VAERS) -

+

+ \ No newline at end of file