Advertisement
Pauan

amcharts3-angular2 AmChartsService

Mar 26th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import { AmChartsService } from "amcharts3-angular2";
  2.  
  3. @Component({
  4. template: `<div id="chartdiv" [style.width.%]="100" [style.height.px]="500"></div>`
  5. })
  6. export class AppComponent {
  7. private chart: any;
  8.  
  9. constructor(private AmCharts: AmChartsService) {}
  10.  
  11. ngOnInit() {
  12. this.chart = this.AmCharts.makeChart("chartdiv", {
  13. "type": "serial",
  14. "theme": "light",
  15. "dataProvider": []
  16. ...
  17. });
  18. }
  19.  
  20. ngOnDestroy() {
  21. this.AmCharts.destroyChart(this.chart);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement