styleUrls: ['./sparkline.component.scss']
})
export class SparklineComponent implements OnInit, OnChanges {
- @ViewChild('sparkCanvas')
+ @ViewChild('sparkCanvas', { static: true })
chartCanvasRef: ElementRef;
- @ViewChild('sparkTooltip')
+ @ViewChild('sparkTooltip', { static: true })
chartTooltipRef: ElementRef;
@Input()
}
];
- options = {
+ options: Record<string, any> = {
animation: {
duration: 0
},
intersect: false,
custom: undefined,
callbacks: {
- label: (tooltipItem) => {
+ label: (tooltipItem: any) => {
if (this.isBinary) {
return this.dimlessBinaryPipe.transform(tooltipItem.yLabel);
} else {
constructor(private dimlessBinaryPipe: DimlessBinaryPipe) {}
ngOnInit() {
- const getStyleTop = (tooltip) => {
+ const getStyleTop = (tooltip: any) => {
return tooltip.caretY - tooltip.height - tooltip.yPadding - 5 + 'px';
};
- const getStyleLeft = (tooltip, positionX) => {
+ const getStyleLeft = (tooltip: any, positionX: number) => {
return positionX + tooltip.caretX + 'px';
};
borderColor: this.colors[0].pointBorderColor
};
- this.options.tooltips.custom = (tooltip) => {
+ this.options.tooltips.custom = (tooltip: any) => {
chartTooltip.customTooltips(tooltip);
};
}