Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 带角度4的立体标尺高度图图形集成_Git_Angular_Charts_Gauge - Fatal编程技术网

Git 带角度4的立体标尺高度图图形集成

Git 带角度4的立体标尺高度图图形集成,git,angular,charts,gauge,Git,Angular,Charts,Gauge,我正在尝试将angular 4与highchart进行集成。我能够得到简单的图表,如条形图等,但在尝试实现实心量表时,出现以下错误: ERROR Error: Highcharts error #17: www.highcharts.com/errors/17 at Object.a.error (highcharts.js:10) at a.Chart.initSeries (highcharts.js:248) at highcharts.js:271 at

我正在尝试将angular 4与highchart进行集成。我能够得到简单的图表,如条形图等,但在尝试实现实心量表时,出现以下错误:

ERROR Error: Highcharts error #17: www.highcharts.com/errors/17
    at Object.a.error (highcharts.js:10)
    at a.Chart.initSeries (highcharts.js:248)
    at highcharts.js:271
    at Array.forEach (<anonymous>)

As per suggesions in other posts I have added the below code in appmodule.ts

    declare var require: any;
    export function highchartsFactory() {

        var hc = require('highcharts');
        var hcm = require('highcharts/highcharts-more');
        var sg = require('highcharts/modules/solid-gauge');

        hcm(hc);
        sg(hc);

        return hc;
    }


    @NgModule({
      declarations: [...],
      imports: [
     .....
        ChartModule
      ],
      providers: [ {provide: HighchartsStatic,useFactory: highchartsFactory}],
      bootstrap: [AppComponent]
    })
    export class AppModule { 
}
错误错误:Highcharts错误#17:www.Highcharts.com/errors/17
at Object.a.error(highcharts.js:10)
在a.Chart.initSeries上(highcharts.js:248)
在highcharts.js:271

在Array.forEach(

这是angular2 highcharts的官方示例,对我来说效果很好

我有同样的问题和非常相似的错误消息,只需将您的代码更改为下面的作品为我

declare var require: any;

@NgModule({
  declarations: [...],
  imports: [
 .....
    ChartModule.forRoot(
      require('highcharts'),
      require('highcharts/modules/exporting'),
      require('highcharts/highcharts-more'),
      require('highcharts/modules/solid-gauge')
    )
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { 

这是angular2 highcharts的官方示例,对我来说效果很好

我有同样的问题和非常相似的错误消息,只需将您的代码更改为下面的作品为我

declare var require: any;

@NgModule({
  declarations: [...],
  imports: [
 .....
    ChartModule.forRoot(
      require('highcharts'),
      require('highcharts/modules/exporting'),
      require('highcharts/highcharts-more'),
      require('highcharts/modules/solid-gauge')
    )
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { 

已编辑代码格式设置+标记有相同问题。任何解决方法?类型为“{chart:{type:string;};title:{text:string;};工具提示:{enabled:boolean;};pane:{cen…”的参数不能分配给类型为“Options”的参数。属性“pane”的类型不兼容。类型为“{center:string[];size:string;startAngle:number;endAngle:number;background:{backgroundC…'不可分配给类型“PaneOptions”。属性“center”的类型不兼容。类型“string[]”不可分配给类型“[string | number,string | number]”。类型“string[]中缺少属性“0”“。编辑了代码格式设置+标记。有任何解决方法吗?类型为“{chart:{type:string;};title:{text:string;};工具提示:{enabled:boolean;};pane:{cen…”的参数不能分配给类型为“Options”的参数。属性“pane”的类型不兼容。类型为“{center:string[];size:string;startAngle:number;endAngle:number;background:{backgroundC…'不可分配给类型“PaneOptions”。属性“center”的类型不兼容。类型“string[]”不可分配给类型“[string | number,string | number]”。类型“string[]”中缺少属性“0”。