Skip to content

Instantly share code, notes, and snippets.

@davelandry
Last active February 7, 2018 16:23
Show Gist options
  • Save davelandry/33fc382f1f1913682ec1 to your computer and use it in GitHub Desktop.
Save davelandry/33fc382f1f1913682ec1 to your computer and use it in GitHub Desktop.
Simple Pie Chart
<!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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment