score:2
To load a map for Highmaps
A map is JSON type file containing mapData code used when a chart is created. Download a map from official Highcharts map collection in Javascript format or use a custom map and add it to your app. Edit the map file, so it could be loaded like a module by adding to beginning and end of a file code below:
(function (factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function (Highcharts) {
...
/* map file data */
...
}));
In case of using a GeoJSON map file format you should add the above code and additionally, between the added beginning and the map file data, the below code:
Highcharts.maps["myMapName"] =
Where "myMapName"
is yours map name that will be used when creating charts. Next, you will be loading a local .js file, so you should add in tsconfig.json
in your app allowJs: true
:
...
"compilerOptions": {
"allowJs": true,
...
The map is ready to be imported to your app.
import * as Highcharts from 'highcharts/highmaps';
import * as HC_myMap from './relative-path-to-the-map-file/map-file-name';
HC_myMap(Highcharts);
Where relative-path-to-the-map-file
should be relative (for the module importing the map) path to the map file and map-file-name
should be the name of the map file.
Source: stackoverflow.com
Related Query
- Angular4 with highcharts can't use world.js
- How to use highcharts with angular 5?
- How To Use Epoch Time With Highcharts Series Data?
- Can we use Highcharts with React-Native?
- How to use highcharts with princeXML?
- Highcharts chart with 'datetime' xAxis - use categories on drilldown
- Rails ActiveRecord group_by & sum db results for use with Lazy HighCharts
- Use Twitter Bootstrap popover with Highcharts
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- How do I use an Highcharts Solid Gauge in angular 6 with typescript?
- Highcharts - Global configuration with common code and unique data & Headings
- Is there any way we can use Highcharts with mPDF converter?
- Can I use highcharts in a pdf generate with prawn in Rails?
- How do I use Highcharts to display candlestick with small values?
- How to use Highmaps and Highcharts with Meteor?
- Use of DotNet HighCharts dll to make charts in code behind
- How to use Highcharts React to create chart with multiple lines for same XAxis?
- how to use highcharts tooltip formatter in python code
- passing formatting JavaScript code to HighCharts with JSON
- Possible to use Highcharts Scatter Plot with categories?
- Returning JSON file with cURL to use data in a HighCharts stock chart
- How to convert string array to ints to use with Highcharts
- How is the proper way to use HighCharts with StencilJS?
- How to use highcharts in reactjs with fetched data from API
- highcharts highmaps parsing json data to display world map with rich info
- What's the code in Highcharts such that the bars (columns) in the same group use the same color?
- Highcharts how to use a percentage area with time
- Highcharts series visibility with csv data source
- highcharts gauge use with negative values
- Returning correctly formatted json response for use in highcharts with Laravel
More Query from same tag
- How to Add Custom Data to Highchart.js Tooltip
- How to turn off inner padding in highcharts?
- Refresh highchart after hiding bar data
- Stop Highcharts overwriting containers
- HighCharts: Line series disappears on click of legend
- Add buttons in chart of Highcharts at runtime
- Bigger chart with highcharts
- Donut Slices Not Visible On Load
- Highcharts using value not an array Ajax
- from csv to scatter plot with HighCharts
- show one series data at a time in high chart column graph
- Combine scatter and line charts with highcharter in R
- Highcharts, datetime, timestamp. What format of date needs when axis has type 'datetime'?
- How can I force ticks/grid lines on a Highcharts datetime X axis to arbitrarily line up with data points?
- React highcharts, show legends as bar
- How to find max: value of colorAxis for highMaps drilldown maps
- Highchart by aggegated data
- How to convert HTML table to Chart?
- Represent extreme values on Doughnut chart in SSRS
- Highcharts 4.0.4 Export Issue on Internet Explorer
- onclick display donut chart pieces' information in center
- Remove border from multiple plots of Stacked and Grouped Column chart (Highcharts.js)
- ReferenceError: Can't find variable: modules
- Highcharts organization change size image and position
- How do I reduce the space between title and chart of a High Chart?
- How to hide an element using javascript
- Highcharts - heatmap : avoid 0 on resize chart
- Display custom values on x axis using Highcharts
- Show customized Mouse over on a bubble chart in Highchart JS
- Highcharts: Disable animation for specific event