angular2-highcharts is not working in angular 11

190 Views Asked by At

I was working with angular2-highcharts it was working since angular 8 but found its not working after I upgrade to angular 11

Here is my snippet

import { ChartModule } from 'angular2-highcharts';

@NgModule( {
    declarations: [
        AppComponent
    ],
    imports: [        
        ChartModule.forRoot(
            require( 'highcharts/highstock' ),
            require( 'highcharts/modules/exporting' ),
            require( 'highcharts/indicators/indicators-all' ),
            require( './highcharts/modules/annotations-advanced.src' ),
            require( 'highcharts/modules/price-indicator' ),
            require( 'highcharts/modules/full-screen' ),
            require( 'highcharts/modules/stock-tools' ),
            require( 'highcharts/modules/drag-panes' ),
            require( 'highcharts/modules/boost' )
        ),      
    ]

} )
2

There are 2 best solutions below

0
On BEST ANSWER

I was also facing same issue I change my framework to highcharts-angular its highcharts official wrapper. and also have several download and good review.

Your project was working with Angular8 because that version uses the "View Engine" compiler while Angular11 uses the Ivy compiler. The short answer answer to your question is NO. angular2-highcharts does not support the new "Ivy compiler"

1
On

As has already been mentioned angular2-highcharts is no longer supported (please see https://github.com/gevgeny/angular2-highcharts). I therefore recommend to use highcharts-angular as well.