1

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

谢谢

import { Component, Optional, OnInit } from '@angular/core';
import { Chart } from 'angular-highcharts';
import { first } from 'rxjs/operators';
import * as Highcharts from 'highcharts'

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

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

  chartData: any[]= [];
  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;
  }

}

请帮我解决这个错误

4

0 回答 0