From b99b1cc13df8d80f68345188b838127e789a6a26 Mon Sep 17 00:00:00 2001 From: BojanSovticEngIT <81489218+BojanSovticEngIT@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:26:03 +0100 Subject: [PATCH] Bugfix KNOWAGE-8228 --- .../WidgetEditorDataTab/WidgetEditorDataTab.vue | 1 + .../ChartWidget/common/ChartColorSettings.vue | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/modules/documentExecution/dashboard/widget/WidgetEditor/WidgetEditorDataTab/WidgetEditorDataTab.vue b/src/modules/documentExecution/dashboard/widget/WidgetEditor/WidgetEditorDataTab/WidgetEditorDataTab.vue index a8a761524..f238f0c43 100644 --- a/src/modules/documentExecution/dashboard/widget/WidgetEditor/WidgetEditorDataTab/WidgetEditorDataTab.vue +++ b/src/modules/documentExecution/dashboard/widget/WidgetEditor/WidgetEditorDataTab/WidgetEditorDataTab.vue @@ -91,6 +91,7 @@ export default defineComponent({ this.widget.settings = createNewHighchartsSettings() this.widget.settings.chart.colors = tempWidgetColors this.widget.settings.chartModel = createNewHighchartsModel(this.widget, type, oldChartModel, chartType.endsWith('Stacked'), chartType.endsWith('Inverted')) + this.widget.settings.chartModel.updateChartColorSettings(this.widget) } else { this.widget.type = 'chartJS' this.widget.settings = createNewChartJSSettings() diff --git a/src/modules/documentExecution/dashboard/widget/WidgetEditor/WidgetEditorSettingsTab/ChartWidget/common/ChartColorSettings.vue b/src/modules/documentExecution/dashboard/widget/WidgetEditor/WidgetEditorSettingsTab/ChartWidget/common/ChartColorSettings.vue index 831c87cb5..3ea8d9f9b 100644 --- a/src/modules/documentExecution/dashboard/widget/WidgetEditor/WidgetEditorSettingsTab/ChartWidget/common/ChartColorSettings.vue +++ b/src/modules/documentExecution/dashboard/widget/WidgetEditor/WidgetEditorSettingsTab/ChartWidget/common/ChartColorSettings.vue @@ -101,10 +101,12 @@ export default defineComponent({ }, onRowReorder(event) { this.widget.settings.chart.colors = [...event.value] + this.updateChartModel() emitter.emit('refreshChart', this.widgetModel.id) }, addColor() { this.widget.settings.chart.colors.push(this.customColorValue) + this.updateChartModel() emitter.emit('refreshChart', this.widgetModel.id) }, changeColor(color) { @@ -123,8 +125,12 @@ export default defineComponent({ }, deleteColor(index) { this.widget.settings.chart.colors.splice(index, 1) + this.updateChartModel() emitter.emit('refreshChart', this.widgetModel.id) }, + updateChartModel() { + if (this.widget.settings.chartModel?.model) this.widget.settings.chartModel.model.colors = this.widget.settings.chart.colors + }, getContrastYIQ() { //getContrastYIQ(hexcolor) { // var getRGBA = function(string) {