refactoring

This commit is contained in:
frankknoll
2023-06-11 09:57:37 +02:00
parent c17bfd1e2d
commit a774a00c24
2 changed files with 14 additions and 4 deletions

View File

@@ -118,12 +118,18 @@ class BatchCodeTableInitializer {
#displayBatchcodeByCountryBarChart(batchcode, barChartDescriptions, uiContainer) {
if (batchcode in barChartDescriptions.barChartDescriptions) {
const barChartDescription = barChartDescriptions.barChartDescriptions[batchcode];
barChartDescription['batchcode'] = batchcode;
new BatchcodeByCountryBarChartView(uiContainer).displayBatchcodeByCountryBarChart(barChartDescription);
new BatchcodeByCountryBarChartView(uiContainer)
.displayBatchcodeByCountryBarChart(this.#getBarChartDescription(barChartDescriptions, batchcode));
}
}
#getBarChartDescription(barChartDescriptions, batchcode) {
const barChartDescription = barChartDescriptions.barChartDescriptions[batchcode];
barChartDescription.batchcode = batchcode;
barChartDescription.dateRange = barChartDescriptions.dateRange;
return barChartDescription;
}
#setVisibilityOfCountriesColumn(batchCodeTable, showCountriesColumn) {
batchCodeTable
.column(this.#getColumnIndex('Countries'))

View File

@@ -35,13 +35,17 @@ class BatchcodeByCountryBarChart {
data: barChartDescription["frequencies before deletion"]
},
{
label: "frequencies guessed", // FK-TODO: daterange einfügen
label: `frequencies guessed ${this.#dateRange2str(barChartDescription.dateRange)}`,
data: barChartDescription["frequencies guessed"]
}
]
};
}
#dateRange2str(dateRange) {
return `${dateRange.start} - ${dateRange.end}`;
}
#getOptions() {
return {
plugins: {