Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to import highcharts offline-exporting in typescript

Tired out the following configurations but they dont seem to work.

import * as Highcharts from 'highcharts/highstock';
/*import * as HighchartsExporting from 'highcharts/modules/exporting';
HighchartsExporting(Highcharts);*/
require('highcharts/modules/offline-exporting')(Highcharts);

get the following error: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures.

anyone knows how to get this working.

like image 883
patz Avatar asked Mar 10 '23 06:03

patz


2 Answers

here is a solution

import * as Highcharts from 'highcharts/highstock';
import * as HighchartsExporting from 'highcharts/modules/exporting';
HighchartsExporting(Highcharts);

this is good enough to work, a separate require command is not required.

like image 90
patz Avatar answered Mar 12 '23 19:03

patz


offline export highcharts:

import * as Highcharts from 'highcharts';
import exporting from 'highcharts/modules/exporting';
import offline from 'highcharts/modules/offline-exporting';
exporting(Highcharts);
offline(Highcharts);
like image 20
Hung Le Avatar answered Mar 12 '23 18:03

Hung Le