From 84ac47e6f26a09d67007f44c97afc2aba4fdff3d Mon Sep 17 00:00:00 2001 From: colinl Date: Sat, 23 May 2026 16:07:42 +0100 Subject: [PATCH] Pass merged ui_update.chartOptions to clients when updates received --- nodes/widgets/ui_chart.js | 2 ++ ui/src/widgets/ui-chart/UIChart.vue | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/nodes/widgets/ui_chart.js b/nodes/widgets/ui_chart.js index 6930f5cf3..1e049be45 100644 --- a/nodes/widgets/ui_chart.js +++ b/nodes/widgets/ui_chart.js @@ -165,6 +165,8 @@ module.exports = function (RED) { // Deep merge new options in with old const mergedOptions = deepMerge(currentOptions, updates.chartOptions) statestore.set(group.getBase(), node, msg, 'chartOptions', mergedOptions) + // pass the full set to the clients so they don't need to do the merge + msg.ui_update.chartOptions = mergedOptions } } diff --git a/ui/src/widgets/ui-chart/UIChart.vue b/ui/src/widgets/ui-chart/UIChart.vue index 71beec29e..b5b771499 100644 --- a/ui/src/widgets/ui-chart/UIChart.vue +++ b/ui/src/widgets/ui-chart/UIChart.vue @@ -34,7 +34,6 @@ export default { }, chartUpdateDebounceTimeout: null, tooltipDataset: [], - dynamicChartOptions: [], // an array of chart options updates received this session resizeObserver: null } }, @@ -193,8 +192,6 @@ export default { if (this.chart) { this.chart.setOption(updates.chartOptions) } - // add these options to the array of previous updates received this session - this.dynamicChartOptions.push(updates.chartOptions) } }, generateChartOptions () { @@ -433,10 +430,6 @@ export default { if (chartOptions) { this.chart.setOption(chartOptions) } - // then from this session - this.dynamicChartOptions.forEach((options) => { - this.chart.setOption(options) - }) } } }