d3.js - How to get only those data which have particular code in crossfilter -
i have following dataset var data= [ {code:501, value:25}, {code:501, value:30}, {code:501, value:30}, {code:501, value:35}, {code:501, value:60}, {code:502, value:25}, {code:502, value:25} ] i want dataset contains data code 501. tried following code var ndx=crossfilter(data); var dim1=ndx.dimension(function(d){return d.code}); var filtereddata=dim1.filter(501); but not working. not returning me data want. tried print returned data using console printed vague things. function getdata(){ var range = $("#range").val()*1; if(isnan(range)){ alert("kindly enter valid number"); }else{ var data= [ {code:501, value:25}, {code:501, value:30}, {code:501, value:30}, {code:501, value:35}, {code:501, value:60}, {code:502, value:25}, {code:502, value:25} ]; var ndx=crossfilter(data); var dim1=ndx.dimension(function(d){return d.code}); var filtereddata=dim1.filter(range); alert("requested data is\n"+(json.st...