etray7
Posts: 7
Joined: Tue Sep 21, 2021 11:23 am

Problem with map chart size

Hi, can you help me please, I have trouble when change map by loading the new one for example I start from USA map and want to load Florida map, I loaded it and it renders properly, but when I return to USA map(load it again) - it loads with wrong size:
Start:
screen1.png
screen1.png (44.17 KiB) Viewed 1433 times
Load Florida:
screen2.png
screen2.png (27.74 KiB) Viewed 1433 times
Return to USA(wrong size):
screen3.png
screen3.png (30.77 KiB) Viewed 1433 times
If it is not Florida, but Iowa for example it will work properly:
Start:
screen1.png
screen1.png (44.17 KiB) Viewed 1433 times
Iowa: Image
Return to USA:
screen1.png
screen1.png (44.17 KiB) Viewed 1433 times
Do anyone know how to fix it?
etray7
Posts: 7
Joined: Tue Sep 21, 2021 11:23 am

Re: Problem with map chart size

I found by my own, if it is interesting for someone, the reason is dataGrouping https://api.highcharts.com/highstock/pl ... PixelWidth
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: Problem with map chart size

Welcome to our forum! That's great to hear that you found a solution.

Feel free to ask any further questions!
Regards
Magdalena Gut
Developer and Highcharts Support Engineer
MartinGerritsenFwk
Posts: 6
Joined: Tue Sep 07, 2021 2:27 pm

Re: Problem with map chart size

Hi, could you elaborate your solution a little bit?
I'm believe I'm having the same issue using the world map with allAreas: false.
I then give a value to one country and the first one looks perfect.
When I change to another country via a dropdown selection, and this country is smaller, the whole content is not resized / redrawn as the first time.
If the country is bigger than the previous country, it works as intended - but when I then go back to the previous or a smaller country , the issue becomes more obvious.

Is there a way to simply make highmaps fill/zoom on the available content automatically, just like it does on init?
reflow and redraw do not work.
MartinGerritsenFwk
Posts: 6
Joined: Tue Sep 07, 2021 2:27 pm

Re: Problem with map chart size

Ok, it was very simple to fix, although I do not understand exactly what it changes.

Code: Select all

plotOptions: {
	series: {
		dataGrouping: {
			enabled: false,
		}
	}
}
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: Problem with map chart size

Hi,

Could you reproduce your example in an online editor? I haven't noticed such behaviour in the official demo https://jsfiddle.net/BlackLabel/qtp5fL8g/

Regards!
Magdalena Gut
Developer and Highcharts Support Engineer

Return to “Highcharts Maps”