mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-17 21:48:08 +01:00
baChartistChart component
This commit is contained in:
parent
352dceb5c5
commit
d32414f626
8 changed files with 94 additions and 23 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
<div class="ba-chartist-chart {{baChartistChartClass || ''}}"></div>
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
1
src/app/theme/components/baChartistChart/index.ts
Normal file
1
src/app/theme/components/baChartistChart/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './baChartistChart.component.ts';
|
||||
|
|
@ -4,3 +4,4 @@ export * from './sidebar';
|
|||
export * from './contentTop';
|
||||
export * from './baCard';
|
||||
export * from './baAmChart';
|
||||
export * from './baChartistChart';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue