highchartsangular-highcharts

Angular Highcharts error missing module for candlestick type


When trying to do a Highcharts candle stock chart with Angular Highcharts: https://github.com/highcharts/highcharts-angular

I get an error seen here:

 ERROR Error: Highcharts error #17: www.highcharts.com/errors/17/?missingModuleFor=candlestick
 - missingModuleFor: candlestick
    at Object.<anonymous> (highcharts.js:12:238)

The link says "The requested series type does not exist"


Solution

  • The fix was to change:

    import * as Highcharts from 'highcharts';
    

    to

    import * as Highcharts from "highcharts/highstock";
    

    Also for indicators don't forget :

    import IndicatorsAll from "highcharts/indicators/indicators-all";
    IndicatorsAll(Highcharts);
    

    Importing modules in mentioned on the highcharts-angular wiki: https://github.com/highcharts/highcharts-angular#to-load-a-module

    Also pass in the constructorType argument as mentioned here: https://github.com/highcharts/highcharts-angular#options-details

    <highcharts-chart
      [Highcharts]="Highcharts"
      [constructorType]="'stockChart'"
      [options]="chartOptions"
    ></highcharts-chart>
    

    There are also demos listed here: https://github.com/highcharts/highcharts-angular#online-examples