2

I'm using the angular2-highcharts(v0.4.1) component in my Ionic2(v2.0.0) project.

When I run my page, I have an error 7 from highcharts.

I tried add this code on my angular component, without success...

import * as Highcharts from 'highcharts';
import * as HighchartsMore from 'highcharts/highcharts-more.js';
HighchartsMore(Highcharts);

And this...

declare var require: any;
const Highcharts = require('../../../node_modules/highcharts/highstock.src');
const HighchartsMore = require('../../../node_modules/highcharts/highcharts-more.js');
HighchartsMore(Highcharts);

Anyone had add some component to this module? or know some library to use highcharts on angular2?


Ionic information:

Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v4.1.0
Xcode version: Not installed
Raugaral
  • 1,303
  • 13
  • 25

1 Answers1

2

I got it working like this (im using vanilla highcharts from npm, not angular2-highcharts, tho!):

import * as HighchartsMore from 'highcharts/highcharts-more';
import Highcharts from 'highcharts';

and in the constructor:

HighchartsMore(Highcharts);

Hope this helps!

tmutrmn
  • 21
  • 1
  • 3