Highcharts 如何修复此错误类型';编号';没有与类型';相同的属性;xRangePointOptions对象';

Highcharts 如何修复此错误类型';编号';没有与类型';相同的属性;xRangePointOptions对象';,highcharts,angular8,angular2-highcharts,angular-highcharts,Highcharts,Angular8,Angular2 Highcharts,Angular Highcharts,我得到的错误类型“number”与类型“XrangePointOptionsObject”没有共同的属性。我想在我的angular项目中添加使用angular highchatrs的条形图,但由于此错误,我无法添加。所以你能帮我解决这个错误吗 谢谢 这是我的component.ts文件 import { Chart } from 'angular-highcharts'; import * as Highcharts from 'highcharts' @Component({ sele

我得到的错误类型“number”与类型“XrangePointOptionsObject”没有共同的属性。我想在我的angular项目中添加使用angular highchatrs的条形图,但由于此错误,我无法添加。所以你能帮我解决这个错误吗

谢谢

这是我的component.ts文件

import { Chart } from 'angular-highcharts';
import * as Highcharts from 'highcharts'

 @Component({
  selector: 'app-bar-chart',
  templateUrl: './bar-chart.component.html',
  styleUrls: ['./bar-chart.component.scss']
 })
export class BarChartComponent implements OnInit {

 orderChart: Chart;
 revenueChart: Chart;
 options: Highcharts.Options;

 constructor() { }

  ngOnInit() {
   this.init();
 }

 init() {
   this.options = {
    chart: {
      type: 'column'
    },
    title: {
      text: 'Total Predected Vs Actual'
   },
   xAxis:{
      categories: ['2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017'],
      crosshair: true        
   },     
   yAxis : {
      min: 0 ,

   },
   tooltip : {
      headerFormat: '<span style = "font-size:10px">{point.key}</span><table>',
      pointFormat: '<tr><td style = "color:{series.color};padding:0">{series.name}: </td>' +
         '<td style = "padding:0"><b>{point.y:.1f} mm</b></td></tr>', footerFormat: '</table>', 
   shared: true, useHTML: true
   },
   plotOptions : {
      column: {
         pointPadding: 0.2,
         borderWidth: 0
      }
   },
   series: [
      {
         name: "Predected",
         data :[14,17,9,10,6,19,6,8]
      },
      {
         name: "Actual",
         data: [65,74,44,66,9,23,36,51]
      }
      ]
 };
 let orderChart = new Chart(this.options);
 this.orderChart = orderChart;

 let revenueChart = new Chart(this.options);
 this.revenueChart = revenueChart;
 }

}
从“角度高度图表”导入{Chart};
从“Highcharts”导入*作为Highcharts
@组成部分({
选择器:“应用程序条形图”,
templateUrl:'./bar chart.component.html',
样式URL:['./条形图.component.scss']
})
导出类BarChartComponent实现OnInit{
顺序图:图表;
收入部分:图表;
选项:海图。选项;
构造函数(){}
恩戈尼尼特(){
this.init();
}
init(){
此选项={
图表:{
类型:“列”
},
标题:{
文本:“预计总金额与实际金额”
},
xAxis:{
类别:[2010年、2011年、2012年、2013年、2014年、2015年、2016年、2017年],
十字准星:对
},     
亚克斯:{
分:0,,
},
工具提示:{
headerFormat:“{point.key}”,
pointFormat:“{series.name}:”+
“{point.y:.1f}mm”,页脚格式:“”,
共享:true,使用HTML:true
},
打印选项:{
专栏:{
点填充:0.2,
边框宽度:0
}
},
系列:[
{
名称:“预测”,
数据:[14,17,9,10,6,19,6,8]
},
{
名称:“实际”,
数据:[65,74,44,66,9,23,36,51]
}
]
};
让orderChart=新图表(this.options);
this.orderChart=orderChart;
让revenueChart=新图表(this.options);
this.revenueChart=revenueChart;
}
}

因此,错误显示在系列中的数据上。

我也面临同样的问题。您需要使用以下输入

[runOutsideAngular]="true"
就这样吧

<highcharts-chart [Highcharts]="Highcharts" [options]="chartOptions.trends" [runOutsideAngular]="true"
            style="width: 100%; height: 400px; display: block;">
</highcharts-chart>

我也面临同样的问题。您需要使用以下输入

[runOutsideAngular]="true"
就这样吧

<highcharts-chart [Highcharts]="Highcharts" [options]="chartOptions.trends" [runOutsideAngular]="true"
            style="width: 100%; height: 400px; display: block;">
</highcharts-chart>


我根据highcharts的说明复制您的代码,一切正常-没有错误。Demo:API:@SebastianWędzel我很感谢你的帮助。我根据highcharts的说明复制了你的代码,一切正常-没有错误。演示:API:@SebastianWędzel我很感谢你的帮助。