angular-highcharts
angular-highcharts copied to clipboard
Follow the steps but fail occurs
I tried the basic steps to use angular-highcharts:
however I´m getting this error:
but in the steps for the basic example there is no provider given any idea?
thanks in advance!
Not sure about the vanilla start-up case, but here's how your module.ts should look once trying to add any extra highcharts modules. I think the error your getting is related to your lack of the providers section I show below. For your case you probably don't need the useFactory part of it, but you should declare HIGHCHARTS_MODULES as a provider.
import { ChartModule, HIGHCHARTS_MODULES } from 'angular-highcharts';
import * as more from 'highcharts/highcharts-more.src';
import * as drilldown from 'highcharts/modules/drilldown.src';
import * as exporting from 'highcharts/modules/exporting.src';
export function highchartsModules() {
return [ more, drilldown, exporting, exportData ];
}
@NgModule({
...
providers: [
{
provide: HIGHCHARTS_MODULES,
useFactory: highchartsModules
}
]
}
still don´t have the typings even installing @types/highcharts, any idea?
Did you update your tsconfig.json file to include highcharts types?
tsconfig.app.json :
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": [
"highcharts"
]
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}
Yes, I did. There must be some missing part of documentation for the vanilla start-up I guess.