@c8y/ngx-components 1023.65.0 → 1023.65.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -199,7 +199,8 @@ class YAxisService {
199
199
  }
200
200
  return new Intl.NumberFormat(this.intlNumberFormatCompliantLocale, {
201
201
  notation: 'compact',
202
- compactDisplay: 'short'
202
+ compactDisplay: 'short',
203
+ maximumFractionDigits: 3
203
204
  }).format(val);
204
205
  }
205
206
  },
@@ -1691,13 +1692,23 @@ class ChartRealtimeService {
1691
1692
  m.time,
1692
1693
  m[datapoint.fragment][datapoint.series].value
1693
1694
  ]);
1695
+ newValues.sort(([a], [b]) => new Date(a).valueOf() - new Date(b).valueOf());
1694
1696
  const datapointId = datapoint.__target?.id + datapoint.fragment + datapoint.series;
1695
1697
  const seriesMatchingDatapoint = allDataSeries.find(s => s['datapointId'] === datapointId);
1696
1698
  if (!seriesMatchingDatapoint) {
1697
1699
  return;
1698
1700
  }
1699
1701
  const seriesDataToUpdate = seriesMatchingDatapoint['data'];
1700
- seriesDataToUpdate.push(...newValues);
1702
+ let lastExistingTimestamp = seriesDataToUpdate.length
1703
+ ? new Date(seriesDataToUpdate[seriesDataToUpdate.length - 1][0]).valueOf()
1704
+ : -Infinity;
1705
+ for (const [timestamp, value] of newValues) {
1706
+ const ts = new Date(timestamp).valueOf();
1707
+ if (ts > lastExistingTimestamp) {
1708
+ seriesDataToUpdate.push([timestamp, value]);
1709
+ lastExistingTimestamp = ts;
1710
+ }
1711
+ }
1701
1712
  seriesMatchingDatapoint['data'] = this.removeValuesBeforeTimeRange(seriesMatchingDatapoint);
1702
1713
  this.checkForValuesAfterTimeRange(seriesMatchingDatapoint['data'], datapoint, datapointOutOfSyncCallback);
1703
1714
  });