Angular2高图 - 更多

时间:2016-11-15 08:43:00

标签: angular highcharts

我正在尝试创建蜘蛛图表。我使用this

但我得到this error

`import { CHART_DIRECTIVES, Highcharts } from 'angular2-highcharts'; 
 import HighchartsMore from 'highcharts/highcharts-more';   
 HighchartsMore(Highcharts);
 ...`

1 个答案:

答案 0 :(得分:1)

简单地这样做,它对我起作用我正在试图获得测量图..这对我有用,并为你设置极地获取蜘蛛图

声明图表模块就像这样

import { ChartModule} from 'angular2-highcharts';

imports

@NgModule({
  declarations: [...],
  imports: [
    ChartModule,
    ....
  ],

并在导出类页面上,您要调用highchart

import * as Highcharts from 'highcharts';
import * as HighchartsMore from 'highcharts/highcharts-more';

HighchartsMore(Highcharts);

export class component {

 constructor(public navCtrl: NavController) {
  this.chart1 = {
     chart:{
     polar: true,
     type:'line',
     backgroundColor:'rgba(255, 255, 255, 0)',
     },
      title : { text : 'simple chart' },
      series: [{
        data: [29.9, 71.5, 106.4, 129.2],
      }]
    };
 }
chart1: Object;

html代码

<chart [options]="chart1" > </chart>