Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. npm install angular2-highcharts --save
  2.  
  3. import { Component } from '@angular/core';
  4.  
  5. @Component({
  6. selector: 'app-root',
  7. templateUrl: './app.component.html',
  8. styleUrls: ['./app.component.css'],
  9. })
  10. export class AppComponent {
  11. title = 'app works!';
  12. options: Object;
  13. constructor() {
  14. this.options = {
  15. title : { text : 'simple chart' },
  16. series: [{
  17. data: [29.9, 71.5, 106.4, 129.2],
  18. }]
  19. };
  20. }
  21.  
  22. }
  23.  
  24. <chart [options]="options"></chart>
  25.  
  26. import { BrowserModule } from '@angular/platform-browser';
  27. import { NgModule } from '@angular/core';
  28. import { FormsModule } from '@angular/forms';
  29. import { HttpModule } from '@angular/http';
  30.  
  31. import { AppComponent } from './app.component';
  32. import {ChartModule} from "angular2-highcharts";
  33.  
  34. @NgModule({
  35. declarations: [
  36. AppComponent
  37. ],
  38. imports: [
  39. BrowserModule,
  40. FormsModule,
  41. HttpModule,ChartModule
  42. ],
  43. providers: [],
  44. bootstrap: [AppComponent]
  45. })
  46. export class AppModule { }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement