score:1
To load maps you could try with something like:
import { ChartModule } from 'angular2-highcharts';
import * as Highcharts from 'highcharts/highmaps';
// add your maps here as they will be added to Highcharts variable
...
imports: [
ChartModule.forRoot(
Highcharts
),
}
You are using Highcharts.maps['custom/world']
so you should load the file with map. The file is JS script that adds to Highcharts.maps
the map file that is later used in chart's config.
If there are problems with loading Highmaps you could try with Highcharts + map module. However, the Angular2-highcharts using forRoot with modules applied internally to the Highcharts and without adding map module first there will not be Highcharts.maps, so you will not be able to load any maps - you could try with:
import * as Highcharts from 'highcharts';
require('highcharts/modules/map')(Highcharts);
// add maps here
...
imports: [
ChartModule.forRoot(
Highcharts // this will pass Highcharts with the map module and maps
),
}
Another option would be to replace mapData: Highcharts.maps['custom/world'],
in series config with content of the map file.
EDIT:
Here's a demo for using Highmaps with angular2-highcharts: http://plnkr.co/edit/AmDfKwhRhshFn3CPprkk?p=preview
If you wan to load mapData from file I suggest loading it as a JSON data from GeoJSON files in map collection or nest the JS map file with same code as modules have (example):
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
...
// map file here
...
}));
Next, you could load this as other modules - require('./path-to-map/your-edited-map-file')' in 'forRoot'. You might need to set
allowJsto
truein
compilerOptionsin
tsconfig.json` on top level of your angular app.
Source: stackoverflow.com
Related Query
- Use a specific map in angular2-highmaps and angular-cli
- How to use Highmaps and Highcharts with Meteor?
- How to import Highmaps map collection in Angular 6
- Highmaps US County map is missing New York and DC (among others)
- Angular2 and Highcharts map - map bubbles not showing up
- Map for Highmaps with England, Wales and Scotland etc
- Unable to load Map Chart in Angular 7 using HighMaps 7
- HighMaps select map from list - Highcharts.geojson and Highcharts.mapDataIndex issues
- I'm trying to use HighChart map and solid guage they both work for my data independetly but I get get lot of errors on I put them on a file
- US Counties map in Highmaps for Angular throws compilation error
- Create custom Map for Highmaps using Shapefiles and QGIS
- How to use a multi-layer map with countries and lakes with Highmaps?
- How to use a custom JSON map in Highmaps
- Highcharts and highmaps plugin render a blank map
- Hightchart map pie : clic and hide specific pie
- Custom map with Highmaps adding mappoint series in latitude and longitude using proj4js
- Highmaps mix Bubble map and maplines causes map offset
- how can I use rangeselector and navigation in highcharts in the given code
- Highcharts Highmaps - hover / click external list and show on map
- how to create a world map using highmaps and disable part of legend?
- How to use the tooltip formatter and still display chart color (like it does by default)?
- How to use highcharts with angular 5?
- use highchart and highstock on the same page
- Possible to use xAxis with type "datetime" and yAxis with categories?
- Use non-emoji version of unicode character (highcharts and plain html)
- Query regarding why and how to use highcharts license
- Change Highmaps map colour
- How to structure Angular with Highcharts and lots of dynamic data
- How to use this highchart map in reactJS
- Make Highchart use a specific targeted time zone
More Query from same tag
- How to use no-data-to-display within Highcharts-Vue wrapper
- Highcharts - Toggling the lines that run parallel to X axis for each value on Y axis?
- Highchart first category label is not wrapping
- How to change highmap bubble color
- Is it possible to make a table with y axis labels of Highcharts bar chart?
- Highcharts legend symbol sizes for scatter charts
- highchart - display value in xaxis as the value I get from the chart data as is without conversion
- HighCharts columns with striated columns
- blank page highchart in using jquery to call json arrary
- put the highchart legend to the bottom of the chart and horizontally centered
- Highcharts - Highstock chart showing double line on hovering data points to show tooltip
- PIE CHART - Data Visualization With DataTables and Highcharts
- highcharts spline with multiple series update every few seconds
- Highcharts Heatmap xAxis tick alignment
- Parsing JSON using jQuery's each from array of arrays
- Higcharts: how to remove the styles of the tooltip container?
- How do i enable scrollbar in highcharts in react
- Draw dynamic rectangle based on date co-ordinates
- Strange behaviour of Highcharts boxplot
- Highchart how to enlarge the plotBands in a gauge?
- json in to a variable and then pass it
- Coloring a label depending on color of slice and using distance
- Call a function from within highchart click event in reactjs
- Stacked Bar chart with multiple yAxis
- No auto resize of yaxis of highcharts in shiny
- Highcharts: displaying datetime like categories
- highstock ie8 error
- Highcharts customization PHP/MySQL
- Is there way to make one column wider than others?
- HIGHCHARTS, Replace zero with 0.1 >