How to import highcharts-more
You don't need to use an external module to use highcharts or any of the extension packages in your Angular app. All you need to do npm install --save highcharts
and then in your component along with the other imports include:
// HIGHCHARTS
import * as Highcharts from 'highcharts';
declare var require: any;
require('highcharts/highcharts-more')(Highcharts);
require('highcharts/modules/solid-gauge')(Highcharts);
require('highcharts/modules/heatmap')(Highcharts);
require('highcharts/modules/treemap')(Highcharts);
require('highcharts/modules/funnel')(Highcharts);
let chartHolder;
and example usage:
ngOnInit() {
chartHolder = Highcharts.chart('container', newOptions);
}
and you can update the chart options:
updateChart(newOptions) {
chartHolder.update(newOptions);
}
The highcharts-more
npm package is deprecated - there's no need to install it. Just make sure highcharts
is installed.
Solution:
import * as Highcharts from 'highcharts';
import more from 'highcharts/highcharts-more';
more(Highcharts);