Skip to content

Instantly share code, notes, and snippets.

@NPashaP
Last active December 15, 2016 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NPashaP/e522b9e9c5695863fa720173c1ee4641 to your computer and use it in GitHub Desktop.
Save NPashaP/e522b9e9c5695863fa720173c1ee4641 to your computer and use it in GitHub Desktop.
bar - Basic example
license: gpl-3.0
<!DOCTYPE html>
<meta charset="utf-8">
<style>
rect{
fill:#42A5F5;
}
</style>
<body>
<svg width="960" height="600"></svg>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="http://vizjs.org/viz.v1.1.7.min.js"></script>
<script>
var data=[['A', 1],['A', 3],['B', 3],['C', 5],['D', 8]];
var bar=viz.bar().data(data);
var svg = d3.select("svg")
.append("g")
.attr("transform","translate(50,50)")
.call(bar);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment