Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating chart.map property on the mapChart has no effect #18648

Open
jszuminski opened this issue Mar 10, 2023 · 2 comments
Open

Updating chart.map property on the mapChart has no effect #18648

jszuminski opened this issue Mar 10, 2023 · 2 comments

Comments

@jszuminski
Copy link
Contributor

jszuminski commented Mar 10, 2023

Behaviour

Nothing shows up when an empty chart is created and then updated with a series (without series.mapData) but with a property chart.map set.

Live demo with steps to reproduce

Demo: https://jsfiddle.net/BlackLabel/t1rgs723/

  1. Run the demo & see that the chart doesn't show up
  2. If you uncomment series.mapData: topology everything works

Product version

Highcharts Maps 10.3.3

@KacperMadej
Copy link

And also the map's suggested/guessed projection is not correctly set (thus the projection.name in the mapView

Workaround: set projection name, and use mapData in series instead of chart.map
https://jsfiddle.net/BlackLabel/t1rgs723/4/

@fzc-seaside-villager
Copy link

Hi,

Thank you for your response.

You said the projection is not correctly set,

mapView: {
  zoom: 1,
  maxZoom: 4,
  projection: {
    name: 'Miller'
  }
},

It seems a normal one, where is the wrong part?

And yes, we can find a few alternatives for this issue.

But since most of the demos listed on the official demo page (https://www.highcharts.com/demo/maps) like beloved ones,
https://www.highcharts.com/samples/maps/demo/all-maps?codepen
https://www.highcharts.com/samples/maps/demo/data-class-ranges?codepen
https://www.highcharts.com/samples/maps/demo/doubleclickzoomto?codepen
they only include

{
  chart: {
    map: topology
  },
}

and do not include

{
  ...
  series: [{
    mapData: topology
  }]
}

It might be confusing when users dynamically generate their mapChart.options from an empty {} to a customised option.
If setting series.mapData: topology is the recommended way, might consider updating the current code demos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants