Hubert Kubiak
Hubert Kubiak

Reputation: 635

How to put pie charts on a SVG map?

I use such a map on my website, it's created by amCharts:

enter image description here

All regions are SVG path elements. I'm thinking how to put a chart.js (or any other) pie chart on each of them. The chart of chart.js is a canvas element. Is there any easy solution to achieve it? I could also change the map provider if neccessary.

This should be the effect:

enter image description here

Upvotes: 0

Views: 540

Answers (1)

xorspark
xorspark

Reputation: 16012

There's a demo on the AmCharts website that shows how to do that. You essentially need to create image markers that you can place on your map using latitude and longitude coordinates and use the positionChanged event to create/update custom external divs which contain your pie charts.

Upvotes: 1

Related Questions