Skip to content

Commit

Permalink
SNRGY-2966 fix chart widget with filters #close
Browse files Browse the repository at this point in the history
  • Loading branch information
franzmueller committed Nov 15, 2023
1 parent e0ef45d commit d7ecb5c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/widgets/charts/export/shared/charts-export.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
}
Expand Down

0 comments on commit d7ecb5c

Please sign in to comment.