Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- npm install angular2-highcharts --save
- import { Component } from '@angular/core';
- @Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.css'],
- })
- export class AppComponent {
- title = 'app works!';
- options: Object;
- constructor() {
- this.options = {
- title : { text : 'simple chart' },
- series: [{
- data: [29.9, 71.5, 106.4, 129.2],
- }]
- };
- }
- }
- <chart [options]="options"></chart>
- import { BrowserModule } from '@angular/platform-browser';
- import { NgModule } from '@angular/core';
- import { FormsModule } from '@angular/forms';
- import { HttpModule } from '@angular/http';
- import { AppComponent } from './app.component';
- import {ChartModule} from "angular2-highcharts";
- @NgModule({
- declarations: [
- AppComponent
- ],
- imports: [
- BrowserModule,
- FormsModule,
- HttpModule,ChartModule
- ],
- providers: [],
- bootstrap: [AppComponent]
- })
- export class AppModule { }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement