Browse Source

Add animation to line chart

pull/1328/head
yksolanki9 3 years ago
parent
commit
ab457a717f
  1. 6
      libs/ui/src/lib/line-chart/line-chart.component.ts

6
libs/ui/src/lib/line-chart/line-chart.component.ts

@ -48,6 +48,7 @@ export class LineChartComponent implements AfterViewInit, OnChanges, OnDestroy {
@Input() benchmarkLabel = ''; @Input() benchmarkLabel = '';
@Input() currency: string; @Input() currency: string;
@Input() historicalDataItems: LineChartItem[]; @Input() historicalDataItems: LineChartItem[];
@Input() isAnimated = true;
@Input() locale: string; @Input() locale: string;
@Input() showGradient = false; @Input() showGradient = false;
@Input() showLegend = false; @Input() showLegend = false;
@ -174,7 +175,10 @@ export class LineChartComponent implements AfterViewInit, OnChanges, OnDestroy {
this.chart = new Chart(this.chartCanvas.nativeElement, { this.chart = new Chart(this.chartCanvas.nativeElement, {
data, data,
options: { options: {
animation: false, animation: this.isAnimated && {
duration: 1000,
easing: 'easeOutCubic'
},
aspectRatio: 16 / 9, aspectRatio: 16 / 9,
elements: { elements: {
point: { point: {

Loading…
Cancel
Save