Skip to content

Instantly share code, notes, and snippets.

@kburnham
Created June 17, 2015 15:06
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 kburnham/52ed403af3a4291df853 to your computer and use it in GitHub Desktop.
Save kburnham/52ed403af3a4291df853 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<div id="chartContainer">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://dimplejs.org/dist/dimple.v2.1.2.min.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/muslim.attitudes.to.USA.China.tsv", function (data) {
var myChart = new dimple.chart(svg, data);
myChart.setBounds(80, 30, 480, 330)
myChart.addMeasureAxis("x", "Score");
myChart.addCategoryAxis("y", "Country");
myChart.addSeries(null, dimple.plot.bar);
myChart.addLegend(200, 10, 380, 20, "right");
myChart.draw();
});
</script>
</div>
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment