Strgt
Posts: 37
Joined: Fri Dec 03, 2021 2:11 pm

how to update "allowPointSelect" for map chart

Hello,

I use "allowPointSelect" to select the states (for example the color of the state become blue) and I have a button beside my map. I want to inactive the selected satate when I click on this Button. I want to know, is there any way to update it?


totalStateButton = chart.renderer.button(i18n[lg.toUpperCase()].totalStateButton, 0 + 0, 77 + padding, null, option, optionHover, option, optionHover)
.attr({
zIndex: 3
})
.on('click', function () {
changeState(i18n[lg.toUpperCase()].totalStateButton);
donutChart.series[0].setData(getDataForDonutChart(mainData,i18n[lg.toUpperCase()].currentState,App.Constants.currentYear,i18n[lg.toUpperCase()].currentGender ,chart));

.add();

Thank you so much in adavance

Best Regards
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: how to update "allowPointSelect" for map chart

Hi Strgt,

Thanks for contacting us with your question.

You should create a function in which you would iterate over series' points and call select() method, which allows you to select and unselect points programatically.
Demo: https://jsfiddle.net/BlackLabel/y5016qdp/

Let me know if that was what you were looking for!
Regards!
Mateusz Bernacik
Highcharts Developer
Strgt
Posts: 37
Joined: Fri Dec 03, 2021 2:11 pm

Re: how to update "allowPointSelect" for map chart

Hello mateusz.b,

Thank you so much, that was really helpfull.

Best Regards
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: how to update "allowPointSelect" for map chart

You're welcome! In case of any further questions, feel free to contact us again.
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Maps”