次の形式のデータが入力された折れ線グラフがあります。
[{"id":"3",
"testSource_id":"2",
"dateTimeTaken":"2013-01-01 14:05:14",
"dateTimeReceived":"2013-03-01 14:05:45",
"reading":"0.90000",
"testSourceLocationDescription":"Somewhere",
"parameter_id":"3",
"inspectionPoint_id":"2",
"testSourceLowerLimit":"3.000000000000000",
"testSourceUpperLimit":"11.000000000000000",
"testSourceLocationLongtitude":"-8.459472656250000",
"testSourceLocationLatitude":"54.201010239738880",
"parameterType":"Flouride",
"unitMeasurement":"F",
"client_id":"1"},......................
マップ上のクリック イベントから渡される値に基づいて、このデータをフィルター処理しようとしています。値 - i - は正しく渡されていますが、何らかの理由でフィルター関数が必要なすべてのデータを返していません。誰でも助けることができますか?
d3.json("Data.php", function(error,data) {
var data = data.filter(function(d) { return d.inspectionPoint_id == i; })
console.log(data)
data.forEach(function(d) {
d.inspectionPoint_id = +d.inspectionPoint_id;
d.dateTimeTaken = parseDate(d.dateTimeTaken);
d.reading = +d.reading;
d.parameterType = d.parameterType;});