angular2-highcharts
angular2-highcharts copied to clipboard
how to use require('highcharts-more'). for some feature like series type: 'arearange'
I added the ability to use highcharts-more and solid gauges by adding the following code to my module
import {ChartModule, HIGHCHARTS_MODULES} from 'angular-highcharts';
// this is how you include the // "extra" highchart advanced features import Highcharts from 'highcharts/highcharts-more.src.js'; import SolidGauge from 'highcharts/modules/solid-gauge.src.js';
export function highchartsModules() { // apply Highcharts Modules to this array return [Highcharts, SolidGauge];
@NgModule({ declarations: [ AppComponent, ], imports: [ChartModule,], })
For me this works:
`//File: app.module.ts import { ChartModule } from 'angular2-highcharts'; import { HighchartsStatic } from 'angular2-highcharts/dist/HighchartsService';
export function highchartsFactory() { const hc = require('highcharts/highstock'); const dd = require('highcharts/modules/exporting'); dd(hc); return hc; }
//Section: Imports imports:[ChartModule],
//Section: Providers providers:[ { provide: HighchartsStatic, useFactory: highchartsFactory } ]`
i have this problem too and i cant create gauge chart in my project, how can i solve this problem
more explanation about my problem is https://github.com/gevgeny/angular2-highcharts/issues/260