import { Component, OnInit, Input } from '@angular/core';
import { Label, Color } from 'ng2-charts';
import { ChartDataSets, ChartOptions } from 'chart.js';

@Component({
  selector: 'app-bar-chart',
  templateUrl: './bar-chart.component.html',
  styleUrls: ['./bar-chart.component.scss']
})
export class BarChartComponent implements OnInit {

  @Input() public barChartData: ChartDataSets;
  @Input() public barChartOptions: ChartOptions;
  @Input() public barChartTitle: string;
  @Input() public barChartLabels: Label[];
  @Input() public barChartColors: Color[] = [
    { // light-blue
      backgroundColor: '#3c8dbc',
      borderColor: '#3c8dbc',
      pointBackgroundColor: '#3c8dbc',
      pointBorderColor: '#fff',
      pointHoverBackgroundColor: '#fff',
      pointHoverBorderColor: '#3c8dbc'
    },
    { // orange
      backgroundColor: '#00a65a',
      borderColor: '#00a65a',
      pointBackgroundColor: '#00a65a',
      pointBorderColor: '#fff',
      pointHoverBackgroundColor: '#fff',
      pointHoverBorderColor: '#00a65a'
    },
    { // red
      backgroundColor: '#f56954',
      borderColor: '#f56954',
      pointBackgroundColor: '#f56954',
      pointBorderColor: '#fff',
      pointHoverBackgroundColor: '#fff',
      pointHoverBorderColor: '#f56954'
    }
  ];
  @Input() public barChartLegend = true;
  @Input() public barChartType:string;
  @Input() public barChartPlugins = [];



  constructor() { }

  ngOnInit() {
  }

}
