nataliao
Posts: 2
Joined: Wed Oct 27, 2021 1:35 pm

New bubble doesn't show after redraw

Hello, I have world map with two series types: map and mapbubble. I added a button and on click new point should be added to mapbubble series. Map is redrawing, but new point isn't visible - it shows after reloading map. I also called function chart.redraw() after using addPoint function, but it's still not showing up. I am adding point using addPoint():

Code: Select all

chart.series[1].addPoint(
      {
        code3: 'USA',
        z: 1,
        color: 'red',
        id: 'US',
      },
      true
    );
In console I see that map is redrawing but why bubble isn't visible?
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: New bubble doesn't show after redraw

Hello nataliao,

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

Please provide me with a simplified working demo. You can start here: https://jsfiddle.net/BlackLabel/Lcf36abd/

Regards!
Mateusz Bernacik
Highcharts Developer
nataliao
Posts: 2
Joined: Wed Oct 27, 2021 1:35 pm

Re: New bubble doesn't show after redraw

Here is a code example: https://stackblitz.com/edit/highcharts- ... mponent.ts.

As you can see, after click on button, color is added to country on a worldMap but new bubble isn't showing up.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: New bubble doesn't show after redraw

Hello nataliao,

It is most likely a bug. I will get back to you with appropriate github ticket and possible workarounds asap.

Regards!
Mateusz Bernacik
Highcharts Developer
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: New bubble doesn't show after redraw

Hi nataliao,

Quick update, as a workaround you can use lat lon options to place the point.
Demo: https://jsfiddle.net/BlackLabel/dzh6j4eq/

When it comes to the issue itself, for some reason the points are placed on through joinby and mapData (from chart.map) and it would be nice to keep this functionality on data update - however the fact this works for init is a bit unexpected. This never worked so it is not a regression, just a bug. Reported here: https://github.com/highcharts/highcharts/issues/16598

Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Maps”