I'm making use of Angular4 and angular2-highcharts. According to the documentation I need to include the highcharts modules with the require attribute. It worked fine for including the highcharts module, but not with the additional modules (highcharts-more, highmaps etc.). When I include more module of highcharts I get errors like:
TypeError: n is not a function
TypeError: n is not a function
at highcharts-more.js:8
at highcharts-more.js:11
I need to implement a heatmap, which is not working now, because it makes use of the extra modules. Any idea how to solve this?
Here is my code for app.module.ts
// solution for angular not picking up required attribute
declare const require: any;
export function highchartsFactory() {
let hc = require('highcharts');
let hex = require('highcharts/modules/exporting');
let hmod = require('highcharts/highcharts-more');
hex(hc);
hmod(hex);
return hc;
}
imports: [
ChartModule,
],
providers: [
{
provide: HighchartsStatic,
useFactory: highchartsFactory
}
]