import { Component, OnInit, OnDestroy, ElementRef, Input, ViewChild } from '@angular/core'; import { CosmosChartService } from './../common/chart.service'; import { ChartCommon } from './../common/chart.common'; @Component({ selector: 'cm-chart', templateUrl: './chart.component.html', styleUrls: ['./chart.component.less'] }) export class CosmosChartComponent extends ChartCommon implements OnInit, OnDestroy { constructor(private chartService: CosmosChartService) { super(chartService); } ngOnInit() { this.chartContainer = this.canvas.nativeElement; } ngOnDestroy() { this.disposeChart(); } }