States with no data assigned to them remain on the plot as a part of a new series after update #7162
Labels
Product: Highcharts Maps
Status: Stale
This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur.
Expected behaviour
After series update all parts of the previous data should be removed from the plot area.
Actual behaviour
States with no data assigned to them remain on the plot as a part of a new series after update. Only the ones with data disappear as expected.
Live demo with steps to reproduce
http://jsfiddle.net/kkulig/hvrmdxx6/
Click Hawai from select list. All states except Worcester (the only one that had a value) are merged into the current map data - click the legend item to examine that.
If we replace the update code:
the_map.series[0].update(series);
with this code:
everything works fine:
http://jsfiddle.net/kkulig/qtvnpcu2/
EDIT
It seems that Highcharts modifies the data array by adding paths to it:
http://jsfiddle.net/kkulig/bw662epx/
If we do data.slice() every time before we pass it to a new series this problem doesn't occur:
http://jsfiddle.net/kkulig/66oex4d5/
END OF EDIT
The text was updated successfully, but these errors were encountered: