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更新代码笔 –
希望这适用于你 –