angular-highcharts
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

angular-highcharts

NPM version NPM downloads Build Status

Requirements

{
  "node": ">=4.2",
  "typings": ">=0.7",
  "angular2": ">=2.0.0-beta.13",
  "highcharts": ">=4.2"
}

Installation

# install angular-highcharts
npm i angular-highcharts

# install highcharts
npm i highcharts

# install required typings
typings install highcharts --ambient

Usage Example

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));
  }
}

Coming soon

  • API Docs
  • Highstocks support
  • Highmaps support

License

MIT © Felix Itzenplitz

Package Sidebar

Install

npm i angular-highcharts@0.1.1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • cebor