Johannes Christ
Johannes Christ

Reputation: 109

Highcharts Highmaps the data does not match with polygons correctly

I built a map with Highmaps: see fiddle

The data comes from this google sheet

see code:

  data: {
googleAPIKey: 'AIzaSyB-ZvAYEcpvptgn77Mfld0iHwSRAVepo7I',
googleSpreadsheetKey: '105jszNGYP9P8g5mnmPY2wZgofnayy8TPZM2RBKYTf-c',
seriesMapping: [{
  'land': 0,
  'inzidenz': 1,
  'value': 1,
  'hc-key': 2,
  'lat': 3,
  'lon': 4
},{
  'land': 0,
  'inzidenz': 1,
  'value': 1,
  'hc-key': 2,
  'lat': 3,
  'lon': 4,
  'z': 1
}],
complete: function(options) {
  options.series[0].name = 'Inzidenz';
  options.series[1].name = 'Labels';
}},

But the data is not displayed on the correct polygons, e.g. the value of Hessen in Bayern etc.

Upvotes: 0

Views: 73

Answers (2)

ppotaczek
ppotaczek

Reputation: 39099

This problem is a Highmaps regression bug: https://github.com/highcharts/highcharts/issues/16782

As a workaround, you can add an empty point on init:

  series: [{
    type: 'map',
    data: [{}],
    ...
  }, ...]

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

Upvotes: 1

Barbara Laird
Barbara Laird

Reputation: 12717

Is there a reason you are using mapbubble instead of map as your series.type?

If you change it to map, it works.

https://jsfiddle.net/vf8o7cnd/1/

Upvotes: 0

Related Questions