import { Component , OnInit } from '@angular/core' ; import { ArcElement , BarController , BarElement , CategoryScale , Chart , DoughnutController , LinearScale , LineController , LineElement , PieController , PointElement , PolarAreaController , RadarController , RadialLinearScale , Title , Tooltip , Legend , } from 'chart.js' ; @ Component ( { selector : 'app-root' , templateUrl : './app.component.html' , } ) export class AppComponent implements OnInit { ngOnInit ( ) { Chart . register ( ArcElement , BarController , BarElement , CategoryScale , DoughnutController , LinearScale , LineController , LineElement , PieController , PointElement , PolarAreaController , RadarController , RadialLinearScale , Title , Tooltip , Legend ) ; } }