0
我試圖借鑑dimple.jsDimple.js條長度
的東西是條沒有達到x軸的簡單的柱狀圖,他們只是看起來像小盒子漂浮。
var svg = dimple.newSvg("body", 2024, 760);
d3.csv("data/data.csv", function(d){
data = d.filter(function(x){return x['Origin'] == 'AK' && x['Year'] == '2006'});
for(i=0;i<data.length;i++){
data[i]['Count'] = +data[i]['Count']
}
console.log(data[10])
chart = new dimple.chart(svg, data);
chart.addCategoryAxis("x", ["Destination"]);
chart.addCategoryAxis("y", ["Count"]);
chart.addSeries(null, dimple.plot.bar);
chart.draw();
我的數據行的一個這樣的數組:
Object { Year: "2006", Origin: "AK", Destination: "OH", Count: 68 }
我怎樣才能使它看起來像一個柱狀圖?我想看看酒吧的完整長度。
感謝