Open AbdurRehman91 opened 6 years ago
Below code worked for me: app.module.ts import { ChartModule } from 'angular2-highcharts'; import { HighchartsStatic } from 'angular2-highcharts/dist/HighchartsService'; declare var require: any; export function highchartsFactory() { return require('highcharts'); }
@NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule,ChartModule], providers: [ { provide: HighchartsStatic, useFactory: highchartsFactory } ], bootstrap: [AppComponent] }) export class AppModule { }
Add the below on top of your Polyfills.ts to: import 'zone.js'; import 'reflect-metadata';
@AbdurRehman91 https://github.com/rijine/ngx-highcharts
Hi,I am using angular 4 and trying to use high charts in angular4 and highchart verison is 0.5.5. But i am facing this issue
Module not found: Error: Can't resolve 'highcharts' Module not found: Error: Can't resolve 'highcharts/modules/exporting'
My app.modules.ts file contains the following `import {ChartModule} from 'angular2-highcharts'; import {HighchartsStatic} from 'angular2-highcharts/dist/HighchartsService';declare var require: any; export function highchartsFactory() { const hc = require('highcharts'); const dd = require('highcharts/modules/exporting'); dd(hc); return hc; //return highcharts; }
@NgModule({
],
}
P.S:I have tried all the solutions(related to this issue) being discussed in this repo,but still the issue is not resloved.
thanks