mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-19 17:00:13 +01:00
amchart moved to own component
This commit is contained in:
parent
0ae41588a9
commit
1cc807d733
8 changed files with 48 additions and 14 deletions
27
src/app/theme/components/baAmChart/baAmChart.component.ts
Normal file
27
src/app/theme/components/baAmChart/baAmChart.component.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import {Component, ViewEncapsulation, Input, Output, ElementRef, EventEmitter} from 'angular2/core';
|
||||
|
||||
import './baAmChart.loader.ts';
|
||||
import {DOM} from "angular2/src/platform/dom/dom_adapter";
|
||||
|
||||
@Component({
|
||||
selector: 'ba-am-chart',
|
||||
styles: [require('./baAmChart.scss')],
|
||||
template: require('./baAmChart.html'),
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class BaAmChart {
|
||||
|
||||
@Input() baAmChartConfiguration:Object;
|
||||
@Input() baAmChartClass:string;
|
||||
@Output() onChartReady = new EventEmitter<any>();
|
||||
|
||||
constructor (private _elementRef:ElementRef) {
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
let el = DOM.querySelector(this._elementRef.nativeElement, '.ba-am-chart');
|
||||
|
||||
let chart = AmCharts.makeChart(el, this.baAmChartConfiguration);
|
||||
this.onChartReady.emit(chart);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue