From 861fbb4db757e20742e533ba9d547631e24ee893 Mon Sep 17 00:00:00 2001 From: Sandeep Kumar Sharma Date: Wed, 2 Feb 2022 18:34:48 +0530 Subject: [PATCH 1/8] fix(bug): brush should not be there for cartesian chart if there is no selection handler --- .../components/cartesian/cartesian-chart.component.ts | 10 ++++++++-- .../cartesian-widget-renderer.component.ts | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) 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..3327f9429 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 isSelectionHandlerAvailable: 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.isSelectionHandlerAvailable) { + 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..a587fa5fd 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" + [isSelectionHandlerAvailable]="!!this.model.selectionHandler" [selectedInterval]="this.selectedInterval" [intervalOptions]="this.intervalOptions" [legend]="this.model.legendPosition" From 0142278e3c103b3d20124952142b6b7201719d6a Mon Sep 17 00:00:00 2001 From: Sandeep Sharma <78212931+itssharmasandeep@users.noreply.github.com> Date: Wed, 2 Feb 2022 19:21:45 +0530 Subject: [PATCH 2/8] Update projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts Co-authored-by: Aaron Steinfeld <45047841+aaron-steinfeld@users.noreply.github.com> --- .../shared/components/cartesian/cartesian-chart.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3327f9429..e834b40f7 100644 --- a/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts +++ b/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts @@ -58,7 +58,7 @@ export class CartesianChartComponent implements OnChanges, OnDestroy { public timeRange?: TimeRange; @Input() - public isSelectionHandlerAvailable: boolean = false; + public isRangeSelectionEnabled: boolean = false; @Input() public intervalOptions?: IntervalValue[]; From 36ad0226de075d9f782aaa13f3b0b86d23d9bbe9 Mon Sep 17 00:00:00 2001 From: Sandeep Sharma <78212931+itssharmasandeep@users.noreply.github.com> Date: Wed, 2 Feb 2022 19:21:50 +0530 Subject: [PATCH 3/8] Update projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts Co-authored-by: Aaron Steinfeld <45047841+aaron-steinfeld@users.noreply.github.com> --- .../shared/components/cartesian/cartesian-chart.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e834b40f7..075bd96ab 100644 --- a/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts +++ b/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts @@ -105,7 +105,7 @@ export class CartesianChartComponent implements OnChanges, OnDestroy { ) ); - if (this.isSelectionHandlerAvailable) { + if (this. isRangeSelectionEnabled) { this.chart.withEventListener(ChartEvent.Select, selectedData => { this.selectionChange.emit(selectedData); }); From 81929c4f7a98244365e2e181a6cd66e5b132a307 Mon Sep 17 00:00:00 2001 From: Sandeep Sharma <78212931+itssharmasandeep@users.noreply.github.com> Date: Wed, 2 Feb 2022 19:21:56 +0530 Subject: [PATCH 4/8] Update projects/observability/src/shared/dashboard/widgets/charts/cartesian-widget/cartesian-widget-renderer.component.ts Co-authored-by: Aaron Steinfeld <45047841+aaron-steinfeld@users.noreply.github.com> --- .../cartesian-widget/cartesian-widget-renderer.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a587fa5fd..2114e2dd0 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,7 +27,7 @@ import { CartesianDataFetcher, CartesianResult, CartesianWidgetModel } from './c [showXAxis]="this.model.showXAxis" [showYAxis]="this.model.showYAxis" [timeRange]="this.timeRange" - [isSelectionHandlerAvailable]="!!this.model.selectionHandler" + [isRangeSelectionEnabled]="!!this.model.selectionHandler" [selectedInterval]="this.selectedInterval" [intervalOptions]="this.intervalOptions" [legend]="this.model.legendPosition" From 601047bf798777b731654e3a3e72b8de26ed43d3 Mon Sep 17 00:00:00 2001 From: Sandeep Sharma <78212931+itssharmasandeep@users.noreply.github.com> Date: Wed, 2 Feb 2022 19:31:21 +0530 Subject: [PATCH 5/8] Update projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts Co-authored-by: Aaron Steinfeld <45047841+aaron-steinfeld@users.noreply.github.com> --- .../shared/components/cartesian/cartesian-chart.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 075bd96ab..dc2cadac3 100644 --- a/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts +++ b/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts @@ -105,7 +105,7 @@ export class CartesianChartComponent implements OnChanges, OnDestroy { ) ); - if (this. isRangeSelectionEnabled) { + if (this.isRangeSelectionEnabled) { this.chart.withEventListener(ChartEvent.Select, selectedData => { this.selectionChange.emit(selectedData); }); From 2ffd69064b1a3b14b9a7ea92503cb209ee87def3 Mon Sep 17 00:00:00 2001 From: Sandeep Sharma <78212931+itssharmasandeep@users.noreply.github.com> Date: Wed, 2 Feb 2022 20:28:07 +0530 Subject: [PATCH 6/8] Update projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts Co-authored-by: Aaron Steinfeld <45047841+aaron-steinfeld@users.noreply.github.com> --- .../shared/components/cartesian/cartesian-chart.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 dc2cadac3..92f501880 100644 --- a/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts +++ b/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts @@ -58,7 +58,7 @@ export class CartesianChartComponent implements OnChanges, OnDestroy { public timeRange?: TimeRange; @Input() - public isRangeSelectionEnabled: boolean = false; + public rangeSelectionEnabled: boolean = false; @Input() public intervalOptions?: IntervalValue[]; From faf959db0aabef2f489656371c1b14cc36caba91 Mon Sep 17 00:00:00 2001 From: Sandeep Sharma <78212931+itssharmasandeep@users.noreply.github.com> Date: Wed, 2 Feb 2022 20:28:14 +0530 Subject: [PATCH 7/8] Update projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts Co-authored-by: Aaron Steinfeld <45047841+aaron-steinfeld@users.noreply.github.com> --- .../shared/components/cartesian/cartesian-chart.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 92f501880..49c6d825f 100644 --- a/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts +++ b/projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts @@ -105,7 +105,7 @@ export class CartesianChartComponent implements OnChanges, OnDestroy { ) ); - if (this.isRangeSelectionEnabled) { + if (this.rangeSelectionEnabled) { this.chart.withEventListener(ChartEvent.Select, selectedData => { this.selectionChange.emit(selectedData); }); From 5c6d67e20a54797551244c0abcee18a9ab8d88b4 Mon Sep 17 00:00:00 2001 From: Sandeep Sharma <78212931+itssharmasandeep@users.noreply.github.com> Date: Wed, 2 Feb 2022 20:28:22 +0530 Subject: [PATCH 8/8] Update projects/observability/src/shared/dashboard/widgets/charts/cartesian-widget/cartesian-widget-renderer.component.ts Co-authored-by: Aaron Steinfeld <45047841+aaron-steinfeld@users.noreply.github.com> --- .../cartesian-widget/cartesian-widget-renderer.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2114e2dd0..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,7 +27,7 @@ import { CartesianDataFetcher, CartesianResult, CartesianWidgetModel } from './c [showXAxis]="this.model.showXAxis" [showYAxis]="this.model.showYAxis" [timeRange]="this.timeRange" - [isRangeSelectionEnabled]="!!this.model.selectionHandler" + [rangeSelectionEnabled]="!!this.model.selectionHandler" [selectedInterval]="this.selectedInterval" [intervalOptions]="this.intervalOptions" [legend]="this.model.legendPosition"