Get value of selected brush
Is their a quick way to get the value of the selected brush in a barChart.
I would need the startDate & EndDate of the brush that the user selects.
Posted a bit to early found the solution in the code volumeChart.brush().extent();
Cool, and yes, chart.brush() returns you a d3 brush which has all the functions from d3 brush available.
Is this feature not supported anymore? if I try to grab it via brush() on dc.barChart. I keep on getting "chart1.brush is not a function". There is also no documentation about this in the dc.js api.
Hi @marctiedemann. It's definitely still supported: https://github.com/dc-js/dc.js/blob/develop/src/coordinate-grid-mixin.js#L941
I don't know why it's undocumented.
Perhaps you've accidentally saved a reference to something that is not a chart, for example by manipulating an axis at the end of your chart initialization? (See "Why does everything break after a call to .xAxis or .yAxis??" in the FAQ.)
Ah yes, thanx I was missing that!