Skip to content

Instantly share code, notes, and snippets.

@dz1984
Last active August 29, 2015 14:02
Show Gist options
  • Save dz1984/8cde2c600e644ce9fedc to your computer and use it in GitHub Desktop.
Save dz1984/8cde2c600e644ce9fedc to your computer and use it in GitHub Desktop.
統計開發單位送出審核案件數

摘要

以開發單位提列環評案件數,得知有哪些營利單位或政府單位,對環境異動有極大影響作用。

RESTful API 規格

/api/dev/send

Receive

{
  "devunit" : "遠雄",
  "count" : 20
}

備註

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="chartContainer">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://dimplejs.org/dist/dimple.v2.0.0.min.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 800, 600);
d3.json("http://eia-donaldisfreak.rhcloud.com/api/summary/dev/send", function (data) {
var myChart = new dimple.chart(svg, data);
myChart.setBounds(50, 20, "90%", "50%")
var x = myChart.addCategoryAxis("x", "devunit"),
y = myChart.addMeasureAxis("y","count");
myChart.addSeries(null, dimple.plot.bar);
myChart.draw();
x.titleShape.text("開發單位");
y.titleShape.text("筆數");
});
</script>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment