Ich möchte Echtzeit-Diagramm in meine angular2-Anwendung einfügen, ich benutze angular2-highcharts.Echtzeit-Diagramm mit angular2-highcharts
npm install angular2-highcharts --save
app.component.ts
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],
}]
};
}
}
app.component.html
<chart [options]="options"></chart>
app.module.ts
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 { }
Ich habe diesen Fehler, wenn läuft meine angular2 Anwendung: "Kein Provider für HighchartsStatic!". Vielen Dank im Voraus.
ChartModule.forRoot() nicht funktioniert – naruto
Haben Sie die [Dokumentation] lesen (https://github.com/gevgeny/angular2-highcharts)? Alle möglichen Syntaxen sind deutlich erklärt ... – AngularChef
Datei systemjs.config.js nicht gefunden ... Karte: { ... 'angular2-highcharts': 'node_modules/angular2-highcharts', 'highcharts': 'node_modules/highcharts', } ... Pakete: { ... highcharts: { Haupt: './highcharts.js', Default: 'js' }, 'angular2-highcharts': { Haupt:' ./index.js' , defaultExtension: 'js' } } – naruto