Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140248

Angular highcharts is returning error trying to draw a histogram

$
0
0

I'm trying to implement this histogram using highcharts and highcharts-angular. I implemented both libraries and got the "Hello World" chart working.

But as soon as I try to change its chart type to 'histogram', I get the following error pointing to the series object:

Type '{series...}' is not assignable to 'SeriesOptionsType'.
Type '{series...}' is not assignable to 'SeriesParetoOptions'.


Hello World:

export class AppComponent {
  Highcharts: typeof Highcharts = Highcharts;
  chartOptions: Highcharts.Options = {
    series: [{
      data: [1, 2, 3],
      type: 'line'
    }]
  };
...
}

Changing chart type, where the error is occuring:

export class ChartComponent implements OnInit {

  Highcharts: typeof Highcharts = Highcharts;
  chartOptions: Highcharts.Options = {
    series: [{
      data: [3.5, 3, 3.2, 3.1, 3.6, 3.9, 3.4]
      type: 'histogram',
      xAxis: 1,
      yAxis: 1,
      baseSeries: 1
    }]
  };

  constructor() {
  }

  ngOnInit() {
  }

}

Viewing all articles
Browse latest Browse all 140248

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>