Commit 7ba4fbf165a5416088ad85ca84d85ff4a1d9a280
1 parent
0ec125a7
UI: Fixed map-utils parse data - not correct index (timeseries without aggregation)
Showing
1 changed file
with
5 additions
and
5 deletions
@@ -330,12 +330,12 @@ export function parseData(input: DatasourceData[], dataIndex?: number): Formatte | @@ -330,12 +330,12 @@ export function parseData(input: DatasourceData[], dataIndex?: number): Formatte | ||
330 | deviceType: null | 330 | deviceType: null |
331 | }; | 331 | }; |
332 | entityArray.filter(el => el.data.length).forEach(el => { | 332 | entityArray.filter(el => el.data.length).forEach(el => { |
333 | - dataIndex = isDefined(dataIndex) ? dataIndex : el.data.length - 1; | ||
334 | - if (!obj.hasOwnProperty(el.dataKey.label) || el.data[dataIndex][1] !== '') { | ||
335 | - obj[el.dataKey.label] = el.data[dataIndex][1]; | ||
336 | - obj[el.dataKey.label + '|ts'] = el.data[dataIndex][0]; | 333 | + const index = isDefined(dataIndex) ? dataIndex : el.data.length - 1; |
334 | + if (!obj.hasOwnProperty(el.dataKey.label) || el.data[index][1] !== '') { | ||
335 | + obj[el.dataKey.label] = el.data[index][1]; | ||
336 | + obj[el.dataKey.label + '|ts'] = el.data[index][0]; | ||
337 | if (el.dataKey.label.toLowerCase() === 'type') { | 337 | if (el.dataKey.label.toLowerCase() === 'type') { |
338 | - obj.deviceType = el.data[dataIndex][1]; | 338 | + obj.deviceType = el.data[index][1]; |
339 | } | 339 | } |
340 | } | 340 | } |
341 | }); | 341 | }); |