Leaflet plugin for adding svg pie charts based on David Gilbertson: "A simple pie chart in SVG".
Should work with Leaflet 1.x.
Inlcude the scripts...
<script src="path/to/leaflet.js"></script>
<script src="path/to/dist/leaflet-piemarker.min.js"></script>
... and add a pie marker.
myMap = L.map(...);
L.Marker.pieMarker([51.505, -0.09], {
iconOptions: {
iconSize: [50,50],
data: [
{label: 'A', value: 0.05, color: 'rgba(0,12,50,0.75)', style:'stroke:black;stroke-width:0.01'},
{label: 'B', value: 0.3, color: 'green'},
{label: 'C', value: 0.2, color: '#00fff'},
]
}
}).addTo(myMap);
- Fix: IE11 compatibility
- Add: minified version in dist/leaflet-piemarker.min.js
- initial commit
- add labels to pie chart
- scale on zoom
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.