robinc87
Posts: 4
Joined: Fri May 14, 2021 6:26 am

how to set default value in world map on angular

https://stackblitz.com/edit/highcharts- ... mponent.ts

how to set default value in the world map on angular
help please
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: how to set default value in world map on angular

Hi,
Welcome to our forum and thanks for contacting us with your question.

Please explain what do you mean by talking about default value.
I don't understand your demo, you need to describe what is there in more details and what do you want to achieve.

Live demo:
https://stackblitz.com/edit/highcharts-angular-map

I'm waiting for news from you.
Best regards.
Sebastian Hajdus
Highcharts Developer
robinc87
Posts: 4
Joined: Fri May 14, 2021 6:26 am

Re: how to set default value in world map on angular

https://stackblitz.com/edit/highcharts- ... map-wdihcr
how to set the default country selected after loading world map
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: how to set default value in world map on angular

Hi,
Here is an example of how you can select a point after click put this inside chart.events.load().
Try to according to this solution and implement in your environment.

Code: Select all

    var selected = chart.series[0].data[66];
    if (selected.code === 'GB') {
      selected.selected = true;
      console.log(selected.selected);
    }

Live demo:
https://jsfiddle.net/BlackLabel/vd3ey8br/

API References:
https://api.highcharts.com/class-refere ... t#selected

Let me know how are you doing with this.
Best regards.
Sebastian Hajdus
Highcharts Developer
robinc87
Posts: 4
Joined: Fri May 14, 2021 6:26 am

Re: how to set default value in world map on angular

https://jsfiddle.net/BlackLabel/qwyoa78h/

look on it

// Pre-select a country
mapChart.get('br').select(); //code
how to apply this code in angular
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: how to set default value in world map on angular

Hi,
We don't have such functionality ready in Angular, you will have to rewrite code by yourself.

Template demo:
https://stackblitz.com/edit/highcharts- ... map-lpngrd

Best regards.
Sebastian Hajdus
Highcharts Developer
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: how to set default value in world map on angular

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

Return to “Highcharts Maps”