Vijay2108
Posts: 1
Joined: Wed Nov 30, 2022 11:04 am

To Dynamically Change the Map Image

I am going to have a Dropdown containing various country names and what I want is When the user selects a country in the dropdown I want to show them the map of that specified country; I was able to get the data of any country I want by using this code

Code: Select all

let chosenCountry = "jp";
    countryMap = require(`@highcharts/map-collection/countries/${chosenCountry}/${chosenCountry}-all.topo.json`);
but When I patched this to highcharts options the image of the map is not at all changing I used

Code: Select all

chart.series[0].update(newData)
but its not working ; I also tried changing the whole highchart options with the country data and reassigining it to the highcharts options it also doesnt work,
Can Some help on this; if you could please do :roll: Thank you
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: To Dynamically Change the Map Image

Hello,

Welcome to our forum and thanks for contacting us with your question!

On our official map demo page you have exactly this example: https://www.highcharts.com/demo/maps/al ... /pl/pl-all

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Maps”