0
我有csv file
是Station ID
,Elev
,Latitude
,Longitude
,County
,Nat_ID
,Year_Built
,Capacity
,YrsStr1
,YrsStr2
,..... 在這裏,我想從YrsStr1
獲得所有列的值,它們的頭直到YrsSt578
並跳過其他列值。以下是跳過列的代碼,但我無法獲取列值?閱讀D3鍵的值
var hd = d3.keys(res[0]);
for (var i = hd.length - 1; i >= 0; i--) {
if((hd[i] === "Station") || (hd[i] === "ID") || (hd[i] === "Elev") || (hd[i] === "Latitude")
|| (hd[i] === "Longitude") || (hd[i] === "County") || (hd[i] === "Nat_ID") || (hd[i] === "Year_Built")
|| (hd[i] === "Capacity")){
}else{
}
}
對於testing..i codepen URL已經使用的樣本數據並警告檢查值...希望這對你有所幫助 –
http://codepen.io/nagasai/pen/pbyvmG更新代碼筆 –
希望這適用於你 –