From d7ecb5c3930128c32a92e039b6a1f741764d8b42 Mon Sep 17 00:00:00 2001 From: franzmueller Date: Wed, 15 Nov 2023 09:12:52 +0100 Subject: [PATCH] SNRGY-2966 fix chart widget with filters #close --- .../charts/export/shared/charts-export.service.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/widgets/charts/export/shared/charts-export.service.ts b/src/app/widgets/charts/export/shared/charts-export.service.ts index 7fe2f588..5f69079c 100644 --- a/src/app/widgets/charts/export/shared/charts-export.service.ts +++ b/src/app/widgets/charts/export/shared/charts-export.service.ts @@ -135,15 +135,14 @@ export class ChartsExportService { value: vAxis.valueType === 'string' ? vAxis.filterValue : Number(vAxis.filterValue), }); } - if (filters.length > 0) { - newField.filters = filters; - } - const exp = widgetProperties.exports?.find(x => x.id === vAxis.instanceId); if (exp !== undefined && ((exp as ChartsExportMeasurementModel).exportDatabaseId === undefined || (exp as ChartsExportMeasurementModel).exportDatabaseId === environment.exportDatabaseIdInternalInfluxDb)) { (newField as QueriesRequestElementInfluxModel).measurement = vAxis.instanceId; (newField as QueriesRequestElementInfluxModel).orderColumnIndex = 1; + if (filters.length > 0) { + newField.filters = filters; + } influxElements.push(newField); influxResultMapper.push(index); } else { @@ -152,6 +151,10 @@ export class ChartsExportService { (newField as QueriesRequestElementTimescaleModel).deviceId = vAxis.deviceId; (newField as QueriesRequestElementInfluxModel).orderColumnIndex = 0; newField.columns[0].name = vAxis.valuePath || vAxis.valueName || ''; + if (filters.length > 0) { + filters.forEach(f => f.column = vAxis.valuePath || vAxis.valueName || ''); + newField.filters = filters; + } timescaleElements.push(newField); timescaleResultMapper.push(index); }