From ab457a717f0b55feff5b9c38e0e367a301f8376f Mon Sep 17 00:00:00 2001 From: yksolanki9 Date: Fri, 7 Oct 2022 19:40:40 +0530 Subject: [PATCH] Add animation to line chart --- libs/ui/src/lib/line-chart/line-chart.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/ui/src/lib/line-chart/line-chart.component.ts b/libs/ui/src/lib/line-chart/line-chart.component.ts index 7c0318d3e..5d9632790 100644 --- a/libs/ui/src/lib/line-chart/line-chart.component.ts +++ b/libs/ui/src/lib/line-chart/line-chart.component.ts @@ -48,6 +48,7 @@ export class LineChartComponent implements AfterViewInit, OnChanges, OnDestroy { @Input() benchmarkLabel = ''; @Input() currency: string; @Input() historicalDataItems: LineChartItem[]; + @Input() isAnimated = true; @Input() locale: string; @Input() showGradient = false; @Input() showLegend = false; @@ -174,7 +175,10 @@ export class LineChartComponent implements AfterViewInit, OnChanges, OnDestroy { this.chart = new Chart(this.chartCanvas.nativeElement, { data, options: { - animation: false, + animation: this.isAnimated && { + duration: 1000, + easing: 'easeOutCubic' + }, aspectRatio: 16 / 9, elements: { point: {