Skip to main content
100%

D3 + Leaflet

✓ Published0🌍 Public
11Cr18Ni9
Last edited Oct 15, 2017
Created on Oct 15, 2017

This example combines D3 v3 and Leaflet to show interactive pie charts on a map. Hovering over a Leaflet marker creates a D3-generated donut chart in a tooltip div, displaying the percentage bound to that marker’s options via `L.marker(latlng, { achieve: d.achieve })`. The map offers OSM, Thunderforest, and USGS tile layers, with marker data accessed through `event.target.options`. D3’s `d3.svg.arc` and `d3.layout.pie` render the SVG chart.

AI-generated description

Built with blockbuilder.org

Utilising marker's option: *L.marker(latlng, { options });* to bind data that we can access it with event.target.options when hoove on markes. That is the perfect way of binding data I can think of.

When move your mouse over the marker, there will be a D3js created pie chart over it.

mit Licensed

Similar vizzes