From f31ade23c7221af71c139d25f87b1353dbe42f14 Mon Sep 17 00:00:00 2001 From: frankknoll Date: Wed, 7 Jun 2023 17:50:01 +0200 Subject: [PATCH] adding ChartDataLabels --- docs/BatchcodeByCountryBarChartView2.js | 26 +++++++++++++++++-------- docs/batchCodeTable.html | 2 ++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/docs/BatchcodeByCountryBarChartView2.js b/docs/BatchcodeByCountryBarChartView2.js index 7c5e50baeb3..a3a38a667a4 100644 --- a/docs/BatchcodeByCountryBarChartView2.js +++ b/docs/BatchcodeByCountryBarChartView2.js @@ -16,6 +16,7 @@ class BatchcodeByCountryBarChartView2 { this.#canvas, { type: 'bar', + plugins: [ChartDataLabels], data: this.#getData(barChartDescription), options: this.#getOptions() }); @@ -45,16 +46,19 @@ class BatchcodeByCountryBarChartView2 { #getOptions() { return { - indexAxis: 'y', - responsive: true, + plugins: { + datalabels: { + anchor: 'end', + align: 'top' + } + }, + title: { + display: true, + position: 'top' + }, scales: { y: { - title: { - display: true, - text: 'Country' - } - }, - x: { + // FK-TODO: im main branch und pages branch in AdverseReactionReportsChartView.js wie hier "precision: 0" setzen ticks: { precision: 0 }, @@ -62,6 +66,12 @@ class BatchcodeByCountryBarChartView2 { display: true, text: 'Frequency' } + }, + x: { + title: { + display: true, + text: 'Country' + } } } }; diff --git a/docs/batchCodeTable.html b/docs/batchCodeTable.html index 880e63f48b5..cba68570c5a 100644 --- a/docs/batchCodeTable.html +++ b/docs/batchCodeTable.html @@ -19,6 +19,8 @@ +