I am new to dc.js.
I have some data:
var data = [ {date: Date.UTC(2015, 4, 4), frame: "frame1" }, {date: Date.UTC(2015, 2, 1), frame: "frame2" }, {date: Date.UTC(2015, 2, 11), frame: "frame3" }, {date: Date.UTC(2015, 1, 4), frame: "frame4" }, ];
And I work with this dc.lineChart :
//configure timeGraph timeGraph = dc.lineChart("#range") .width(document.body.clientWidth) .height(100) .dimension(byDate) .group(byDateGroup) .transitionDuration(500) .elasticY(true) .x(d3.time.scale().domain([(byDate.bottom(1))[0].date, (byDate.top(1))[0].date + 1000])) ;
And I would like to access data that is filtered using the adjustable range selection bar. I think that passing a function to onfiltered will work, but I don't know what to get from chart to return the data that is currently filtered.
timeGraph.on("filtered", function (chart) { console.log(); });
Here is a JSFiddle example with an example. If the example should work correctly, everything displayed in the table should appear on the console.
Thanks in advance.
source share