{
"node": ">=4.2",
"typings": ">=0.7",
"angular2": ">=2.0.0-beta.13",
"highcharts": ">=4.2"
}
# install angular-highcharts
npm i angular-highcharts
# install highcharts
npm i highcharts
# install required typings
typings install highcharts --ambient
import {ChartDirective, Chart} from 'angular-highcharts';
@Component({
...
template: `
<button (click)="add()">Add Point!</button>
<div [chart]="chart"></div>`,
directives: [ChartDirective]
})
export class ChartComponent {
chart = new Chart({
chart: {
type: 'line'
},
title: {
text: 'Linechart'
},
credits: {
enabled: false
},
series: [{
name: 'Line 1',
data: [1, 2, 3]
}]
});
// add point to chart serie (addpoint(point, [serieIndex]))
add() {
this.chart.addPoint(Math.floor(Math.random() * 10));
}
}
- API Docs
- Highstocks support
- Highmaps support
MIT © Felix Itzenplitz