Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {Component, OnInit, ViewChild, Input, ElementRef} from '@angular/core';
- import {ChartService, ComparisonData} from '../../core/services/chart.service';
- @Component({
- selector: 'custom-chart',
- template: '<canvas #myCanvas></canvas>'
- })
- export class CustomComponent implements OnInit {
- @ViewChild('myCanvas') canvasRef: ElementRef;
- @Input() data: ComparisonData;
- constructor(
- private chartService: ChartService
- ) {}
- ngOnInit(): void {
- this.chartService.drawComparisonChart(this.canvasRef, this.data);
- }
- }
Add Comment
Please, Sign In to add comment