ChilllyWolf
Posts: 7
Joined: Wed Dec 02, 2020 3:57 pm

Defining size and color columns for mapbubble

Hi,

I want to create a bubble map that has two columns as values, so the size is based on the first one and color based on the second one.

As example :

data = [{name :'a', y: 15, z: 1200}, {name :'b', y: 5, z: 2200}, {name :'c', y: 20, z: 3200} ]

so the map will be sized by 'z' and colored by 'y' and showed with double legend.

Is this possible ?
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Defining size and color columns for mapbubble

Hello ChilllyWolf!

We appreciate you reaching out to us!

All right, but on what map do you want to work? USA, Europe? We should know that and I'm not sure how would you like to look it like. Column series, map series, and bubble series? If it goes about that combination we can't do it, because in HighMaps we can use only the series you can see in API, here: https://api.highcharts.com/highmaps/series

If you could provide me a sketch, screenshot e.t.c it would help me a lot. :)

Best regards!
Dominik Chudy
Highcharts Developer
ChilllyWolf
Posts: 7
Joined: Wed Dec 02, 2020 3:57 pm

Re: Defining size and color columns for mapbubble

As you can see below in legend I have sized bubble, and numeric values

What I want is to make the bubble size linked to a column ie. y or value column, in the same map the color of the bubble is changed by the z column value

You can check it here : https://jsfiddle.net/theAN10/veba4f3g/84/
capture.PNG
capture.PNG (68.53 KiB) Viewed 2082 times
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Defining size and color columns for mapbubble

Hi again!

Thanks for the demo.

I'm not sure if I understood you correctly. The size of bubbles depends on the data you've provided to this series, which is the value that is assigned to each country. How would you like to change it? The size of bubbles already depends on the country they are in.

If it goes about color, the countries don't have any colors as far as I see. Do you want to assign to each country a color, and then paint the bubble with this color? Is that something you want to achieve? :)

Best regards!
Dominik Chudy
Highcharts Developer
ChilllyWolf
Posts: 7
Joined: Wed Dec 02, 2020 3:57 pm

Re: Defining size and color columns for mapbubble

I managed to do it by function
https://jsfiddle.net/theAN10/0sg3td6k/40/

As you can notice the color of each point is based on the 'value' column, while the size is based on the 'z' column
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Defining size and color columns for mapbubble

Hi again!

Thanks for sharing your solution with us!

All right, so you wanted to color the country red when its value was bigger than 3 to yellow when its value was bigger than 5, and so on. I didn't get it. Anyway, congrats on finding the solution. :)

Feel free to ask any further questions!
Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Maps”