Angular 2 - HighCharts实现:找不到名称'HighchartsOptions'

时间:2017-01-24 19:48:46

标签: angular highcharts

我目前正在尝试在Angular2项目中实现Highcharts。不幸的是我收到此错误:找不到名称'HighchartsOptions' 我使用的教程链接。 www.npmjs.com/package/angular2-highcharts#installation

Browser log: Module.ts

import { Component } from '@angular/core';

@Component({
selector: 'simple-chart-example',
template: `
    <chart [options]="options"></chart>
`
})
export class MyChart {
constructor() {
this.options = {
  title : { text : 'simple chart' },
  series: [{
    data: [29.9, 71.5, 106.4, 129.2],
  }]
};
}
options: HighchartsOptions; //That's the line where I get the error
enter code here
}

1 个答案:

答案 0 :(得分:1)

更改...

options:HighchartsOptions

为...

options:Object;