From 5971dcd3f4b7989768a232bbbc101140353cff57 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 19 Feb 2023 21:21:38 +0100 Subject: [PATCH] Enable to read YAxis Ticks from a datapoint to enable external dynamic scaling if wanted --- ioBroker/NsPanelTs.ts | 8 +++++--- ioBroker/NsPanelTs_without_Examples.ts | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index 5597c222..9bcb817b 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -4695,15 +4695,17 @@ function GenerateChartPage(page: PageChart): Payload[] { let txt = getState(id + '.ACTUAL').val; + let yAxisTicks = (typeof page.items[0].yAxisTicks == 'object') ? page.items[0].yAxisTicks : JSON.parse(getState(page.items[0].yAxisTicks).val); + out_msgs.push({ payload: 'entityUpd~' + //entityUpd heading + '~' + //heading GetNavigationString(pageId) + '~' + //navigation rgb_dec565(page.items[0].onColor) + '~' + //color page.items[0].yAxis + '~' + - page.items[0].yAxisTicks.join(':') + '~' + + yAxisTicks.join(':') + '~' + txt - }); + }); if (Debug) console.log(out_msgs); @@ -7362,7 +7364,7 @@ type PageItem = { setThermoAlias: (string[] | undefined), setThermoDestTemp2: (string | undefined), yAxis: (string | undefined), - yAxisTicks: (number[] | undefined), + yAxisTicks: (number[] | string | undefined), xAxisDecorationId: (string | undefined), popupType: (string | undefined), popupOptions: (string[] | undefined), diff --git a/ioBroker/NsPanelTs_without_Examples.ts b/ioBroker/NsPanelTs_without_Examples.ts index db76771c..834b475c 100644 --- a/ioBroker/NsPanelTs_without_Examples.ts +++ b/ioBroker/NsPanelTs_without_Examples.ts @@ -4313,15 +4313,17 @@ function GenerateChartPage(page: PageChart): Payload[] { let txt = getState(id + '.ACTUAL').val; + let yAxisTicks = (typeof page.items[0].yAxisTicks == 'object') ? page.items[0].yAxisTicks : JSON.parse(getState(page.items[0].yAxisTicks).val); + out_msgs.push({ payload: 'entityUpd~' + //entityUpd heading + '~' + //heading GetNavigationString(pageId) + '~' + //navigation rgb_dec565(page.items[0].onColor) + '~' + //color page.items[0].yAxis + '~' + - page.items[0].yAxisTicks.join(':') + '~' + + yAxisTicks.join(':') + '~' + txt - }); + }); if (Debug) console.log(out_msgs); @@ -6980,7 +6982,7 @@ type PageItem = { setThermoAlias: (string[] | undefined), setThermoDestTemp2: (string | undefined), yAxis: (string | undefined), - yAxisTicks: (number[] | undefined), + yAxisTicks: (number[] | string | undefined), xAxisDecorationId: (string | undefined), popupType: (string | undefined), popupOptions: (string[] | undefined),