i find another ways to render the map.

series: [{
          data: highcharts.geojson(highcharts.maps[' ... /us-all.js']),
          name: 'usa',
          datalabels: {
            enabled: true,
            format: '{}'

from highcharts forum example

basically call the js source url to create the map, but i prefer use jordan enev's way.

after i take a look, highcharts already gave the map collection, you can install the dependency @highcharts/map-collection example

after that you can try

import react, { component } from 'react';
import highcharts from 'highcharts/highmaps';
import exporting from 'highcharts/modules/exporting';
window.highcharts = highcharts;
class choroplethmap extends component {
export default choroplethmap;

this issue already raise on this issue



the maps are now available from npm. you can import them directly into your component and pass it to highcharts through the options object.

npm i @highcharts/map-collection

import mapdataworld from '@highcharts/map-collection/custom/world.geo.json'

series: [
    mapdata: mapdataworld,
    name: "asia",
    data: data


according the official highcharts documentation you have to manualy include the map script:

in short, the geojson version of the map is loaded in a script tag in the page. this geojson object is then registered to the highcharts.maps object, and applied to the mapdata option in the chart setup.

as you can see in the fiddle you mentioned, they included the map with the script tag:

<script src=""></script>

because of the above script include, the map is available in highcharts.maps['custom/world'].

so in the react module you have to manually add the desired maps, like in the demo you mentioned. for example, if you want to add the world map, then:

  1. get it from here:
  2. replace highcharts.maps["custom/world"] = with module.exports = in the above file.
  3. load the map in your component const map = require('./maps/world');
  4. then you can reference it in the config mapdata: map

i understand that you want to skip the above process, but currently there isn't any react module that includes the map.

actually there is a hackish way you can do it ... in your html file, where the react scripts are included, there you can include world.js script tag, but first you have to make sure that highcharts.maps object array exist. in that fashion you'll use the maps externally.

however this is a bad practice, because of your react's components will be dependend on that map script.

good practice is to manage your vendor modules via package manager and reference the modules in the components. in that way the components are self-descriptive

Related Query

More Query from same tag