import { Component, ElementRef, OnInit, Input } from '@angular/core'; import { CfChartComponent } from '../chart/chart.component'; import { PieChartModel } from '../../models/chart/pie-chart.model'; /** *

Pie chart component

*/ @Component({ selector: 'cf-pie-chart', template: " ", styles: [""] }) export class CfPieChartComponent extends CfChartComponent implements OnInit { /** *

Should doughnut instead of pie slices

*/ @Input() donut: boolean = false; /** *

Show or hide the labels

*/ @Input() showLabels: boolean = true; /** *

Make the radius of each slice proportional to it's value

*/ @Input() explodeSlices: boolean = false; constructor(public elementRef: ElementRef) { super(elementRef); } ngOnInit(): void { super.ngOnInit(); if (! this.properties) { this.properties = new PieChartModel(); } if (this.donut) { this.properties.donut = this.donut; } if (this.showLabels) { this.properties.showLabels = this.showLabels; } if (this.explodeSlices) { this.properties.explodeSlices = this.explodeSlices; } this.setCommonProperties(); } }