ZingChart: Add and hook shapes to maps

You can add shapes to maps using the regular x, y coordinates but another way would be to hook the shape to the state/exact position of the map. The issue with X,Y coordinates is that when the chart resizes the x/y coordinate moves.

If you are looking to have a shape stay in an exact location no matter the size of the chart, we can hook shapes to maps using longitude and latitude coordinates.

This is done as such:

'x':'someNumberlon'
  'y':'someNumberlat'

So with numbers it will look something like:

'x':'2.5525lon'
  'y':'28.2072lat'

Here is a demo of showing how this is done for the map usa:

USA Map Demo

Here is a demo showing how this is done for a continent map of Africa:

Africa Map Demo

If you are wondering how to get latitude and longitude numbers for a specific X/Y coordinate on your chart you can use ZingChart's getLonLat() method.
 Here is documentation on how to use the getLonLat() method:

getLongLat() Method Docs

Help Center: https://www.zingchart.com/support
Contact Us: support@zingchart.com
Follow Us: twitter.com/zingchart
zingchart.com | +1 858 490 5281

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us