diff --git a/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts b/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts index 130b8d530..49c6d825f 100644 --- a/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts +++ b/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts @@ -57,6 +57,9 @@ export class CartesianChartComponent implements OnChanges, OnDestroy { @Input() public timeRange?: TimeRange; + @Input() + public rangeSelectionEnabled: boolean = false; + @Input() public intervalOptions?: IntervalValue[]; @@ -100,10 +103,13 @@ export class CartesianChartComponent implements OnChanges, OnDestroy { this.chartTooltipBuilderService.constructTooltip>(data => this.convertToDefaultTooltipRenderData(data) ) - ) - .withEventListener(ChartEvent.Select, selectedData => { + ); + + if (this.rangeSelectionEnabled) { + this.chart.withEventListener(ChartEvent.Select, selectedData => { this.selectionChange.emit(selectedData); }); + } if (this.bands) { this.chart.withBands(...this.bands); diff --git a/projects/observability/src/shared/dashboard/widgets/charts/cartesian-widget/cartesian-widget-renderer.component.ts b/projects/observability/src/shared/dashboard/widgets/charts/cartesian-widget/cartesian-widget-renderer.component.ts index d1f04f134..7cac9fac4 100644 --- a/projects/observability/src/shared/dashboard/widgets/charts/cartesian-widget/cartesian-widget-renderer.component.ts +++ b/projects/observability/src/shared/dashboard/widgets/charts/cartesian-widget/cartesian-widget-renderer.component.ts @@ -27,6 +27,7 @@ import { CartesianDataFetcher, CartesianResult, CartesianWidgetModel } from './c [showXAxis]="this.model.showXAxis" [showYAxis]="this.model.showYAxis" [timeRange]="this.timeRange" + [rangeSelectionEnabled]="!!this.model.selectionHandler" [selectedInterval]="this.selectedInterval" [intervalOptions]="this.intervalOptions" [legend]="this.model.legendPosition"