gevgeny / angular2-highcharts

:bar_chart: :chart_with_upwards_trend: Highcharts for your Angular project
MIT License
380 stars 113 forks source link

Highcharts error #17 when create a pie chart #192

Open wanpeng2008 opened 7 years ago

wanpeng2008 commented 7 years ago

i use following codes to display a map:

`export function highChartsMapFactory() { const hc = require('highcharts/highmaps'); const dd = require('highcharts/modules/exporting'); dd(hc); return hc; } @NgModule({ ... providers:[ { provide: HighchartsStatic, useFactory: highChartsMapFactory }, ] })

` it worked well. But when i tried to add another pie chart, ' Highcharts error #17' error arised. soi replaced the highChartsMapFactory code to support highcharts-more:

export function highChartsChartFactory() { const hc = require('highcharts'); const hcMore = require('highcharts/highcharts-more'); hcMore(hc); return hc; } Then the pie chart worked well but the map throwed a critical error that 'Map is unknown chart type'

Anyone can tell me how to display the map and pie chart in the same page correctly?

anafreitas commented 7 years ago

+1

vmohir commented 6 years ago

You need to import highcharts and then import map as a module. Take a look at this code