baChartistChart component

This commit is contained in:
nixa 2016-05-12 18:36:51 +03:00
parent 352dceb5c5
commit d32414f626
8 changed files with 94 additions and 23 deletions

View file

@ -0,0 +1,34 @@
import {Component, ViewEncapsulation, Input, Output, ElementRef, EventEmitter} from '@angular/core';
import './baChartistChart.loader.ts';
@Component({
selector: 'ba-chartist-chart',
styles: [require('chartist/dist/chartist.css'), require('./baChartistChart.scss')],
template: require('./baChartistChart.html'),
encapsulation: ViewEncapsulation.None,
providers: [],
})
export class BaChartistChart {
@Input() baChartistChartType:string;
@Input() baChartistChartData:Object;
@Input() baChartistChartOptions:Object;
@Input() baChartistChartResponsive:Object;
@Input() baChartistChartClass:string;
@Output() onChartReady = new EventEmitter<any>();
constructor (private _elementRef:ElementRef) {
}
ngOnInit() {
}
ngAfterViewInit() {
let el = this._elementRef.nativeElement.querySelector('.ba-chartist-chart');
let chart = new Chartist[this.baChartistChartType](el, this.baChartistChartData, this.baChartistChartOptions, this.baChartistChartResponsive);
this.onChartReady.emit(chart);
}
}

View file

@ -0,0 +1 @@
<div class="ba-chartist-chart {{baChartistChartClass || ''}}"></div>

View file

@ -0,0 +1 @@
export * from './baChartistChart.component.ts';

View file

@ -4,3 +4,4 @@ export * from './sidebar';
export * from './contentTop';
export * from './baCard';
export * from './baAmChart';
export * from './baChartistChart';