Pie Charts are really easy to make with d3plus. The data only needs to have .id() and .size() values. In general, it operates very similar to tree maps, including data nesting and grouping.
Featured on D3plus.org
Pie Charts are really easy to make with d3plus. The data only needs to have .id() and .size() values. In general, it operates very similar to tree maps, including data nesting and grouping.
Featured on D3plus.org
<!doctype html> | |
<meta charset="utf-8"> | |
<script src="//d3plus.org/js/d3.js"></script> | |
<script src="//d3plus.org/js/d3plus.js"></script> | |
<div id="viz"></div> | |
<script> | |
var data = [ | |
{"value": 100, "name": "alpha"}, | |
{"value": 70, "name": "beta"}, | |
{"value": 40, "name": "gamma"}, | |
{"value": 15, "name": "delta"}, | |
{"value": 5, "name": "epsilon"}, | |
{"value": 1, "name": "zeta"} | |
] | |
d3plus.viz() | |
.container("#viz") | |
.data(data) | |
.type("pie") | |
.id("name") | |
.size("value") | |
.draw() | |
</script> |