import { Component, ElementRef, OnInit, Input } from '@angular/core'; import { CfChartComponent } from '../chart/chart.component'; import { BarChartModel } from '../../models/chart/bar-chart.model'; /** *
Bar chart component
*/ @Component({ selector: 'cf-bar-chart', template: "Chart orientation
*/ @Input() orientation: string; /** *Defines if the chart is grouped
*/ @Input() grouped: boolean; /** *Defines if the chart is stacked
*/ @Input() stacked: boolean; constructor(public elementRef: ElementRef) { super(elementRef); } ngOnInit(): void { super.ngOnInit(); if (! this.properties) { this.properties = new BarChartModel(); } if (this.orientation) { this.properties.orientation = this.orientation; } if (this.grouped) { this.properties.grouped = this.grouped; } if (this.stacked) { this.properties.stacked = this.stacked; } this.setCommonProperties(); } }