@c8y/ngx-components 1024.20.0 → 1024.20.1

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.
@@ -733,13 +733,20 @@ class DatapointsGraphWidgetViewComponent {
733
733
  this.updateSelectedItems();
734
734
  const getDatapointId = (dp) => `${dp.__target?.id}${dp.fragment}${dp.series}`;
735
735
  const isLoaded = this.loadedDatapoints.find(dp => getDatapointId(dp) === getDatapointId(datapoint));
736
- if (datapoint.__active && !isLoaded) {
737
- // Datapoint being shown but not loaded (or data is stale) - trigger full reload
738
- this.loadedDatapoints.push(datapoint);
736
+ // A datapoint can be "loaded" yet no longer present in the chart if a full rebuild ran while it
737
+ // was hidden (the fetch pipeline drops inactive datapoints). Toggling legend visibility would
738
+ // then do nothing, so re-fetch instead of just flipping the legend.
739
+ const needsReload = datapoint.__active &&
740
+ (!isLoaded || !this.chartComponent.hasRenderedDatapointSeries(datapoint));
741
+ if (needsReload) {
742
+ // Datapoint being shown but not loaded/rendered (or data is stale) - trigger full reload
743
+ if (!isLoaded) {
744
+ this.loadedDatapoints.push(datapoint);
745
+ }
739
746
  this.displayConfig = { ...this.displayConfig };
740
747
  }
741
748
  else {
742
- // Datapoint already loaded with fresh data OR being hidden - just toggle visibility in echarts
749
+ // Datapoint already loaded and rendered OR being hidden - just toggle visibility in echarts
743
750
  this.chartComponent.toggleDatapointSeriesVisibility(datapoint);
744
751
  }
745
752
  }
@@ -764,7 +771,8 @@ class DatapointsGraphWidgetViewComponent {
764
771
  const params = {
765
772
  data: {
766
773
  itemType: alarm.filters.type
767
- }
774
+ },
775
+ seriesName: `${alarm.filters.type}/${alarm.__target?.id}-markPoint`
768
776
  };
769
777
  this.chartComponent.onChartClick(params);
770
778
  }