|
|
|
@ -24,6 +24,7 @@ import { |
|
|
|
import { |
|
|
|
type AnimationsSpec, |
|
|
|
Chart, |
|
|
|
Decimation, |
|
|
|
Filler, |
|
|
|
LinearScale, |
|
|
|
LineController, |
|
|
|
@ -56,6 +57,7 @@ export class GfLineChartComponent |
|
|
|
@Input() benchmarkLabel = ''; |
|
|
|
@Input() colorScheme?: ColorScheme; |
|
|
|
@Input() currency: string; |
|
|
|
@Input() dataDecimation = false; |
|
|
|
@Input() historicalDataItems: LineChartItem[]; |
|
|
|
@Input() isAnimated = false; |
|
|
|
@Input() label: string; |
|
|
|
@ -80,6 +82,7 @@ export class GfLineChartComponent |
|
|
|
|
|
|
|
public constructor(private changeDetectorRef: ChangeDetectorRef) { |
|
|
|
Chart.register( |
|
|
|
Decimation, |
|
|
|
Filler, |
|
|
|
LineController, |
|
|
|
LineElement, |
|
|
|
@ -199,6 +202,9 @@ export class GfLineChartComponent |
|
|
|
this.chart.options.plugins ??= {}; |
|
|
|
this.chart.options.plugins.tooltip = |
|
|
|
this.getTooltipPluginConfiguration(); |
|
|
|
this.chart.options.plugins.decimation = this.dataDecimation |
|
|
|
? { algorithm: 'lttb', enabled: true } |
|
|
|
: undefined; |
|
|
|
this.chart.options.animations = this.isAnimated |
|
|
|
? animations |
|
|
|
: undefined; |
|
|
|
@ -218,6 +224,9 @@ export class GfLineChartComponent |
|
|
|
}, |
|
|
|
interaction: { intersect: false, mode: 'index' }, |
|
|
|
plugins: { |
|
|
|
decimation: this.dataDecimation |
|
|
|
? { algorithm: 'lttb', enabled: true } |
|
|
|
: undefined, |
|
|
|
legend: { |
|
|
|
align: 'start', |
|
|
|
display: this.showLegend, |
|
|
|
|