I\'m using a lineChart to show created date (one field in my data), it works fine and I can select, but I need a more precise filter: only for items created today, this week, la
I added a feature to be able to select the current day, current week or current month:
d3.select('#date_select').on('change', function(){
var nd = new Date(), now = new Date();
switch (this.value) {
case "today":
nd = d3.time.day(now);
break;
case "week":
nd = d3.time.monday(now);
break;
case "month":
nd = d3.time.month(now);
break;
default:
nd.setDate(nd.getDate() - +this.value);
}
dim.filterAll();
dim.filterRange([nd, now]);
//did not work graph.replaceFilter(dc.RangedFilter(nd, now));
graph.redrawGroup();
});
and the html being: