0

How can I restrict the width of the selection on a barChart?
Screenshot I don't want allow the user to select more than 4 bars (in my case each bar = week)

var moveDays = ndx.dimension(function (d) {return d.week;});
var volumeByMonthGroup = moveDays.group();

dateRangeChart
    .width(1360)
    .height(35)
    .margins({top: 0, right: 50, bottom: 20, left: 80})
    .dimension(moveDays)
    .group(volumeByMonthGroup)
    .gap(2)
    .x(d3.time.scale().domain([minDate,maxDate]))
    .xUnits(d3.time.mondays)
    .alwaysUseRounding(true)
    .round(d3.time.monday.round);
cdlane
  • 40,441
  • 5
  • 32
  • 81
felsher
  • 85
  • 2
  • 12
  • [This appears to require some hacking in d3](http://stackoverflow.com/q/12354729/676195), which dc.js relies on. If you were to implement that answer in dc.js, I think you could do it by overriding [extendBrush](https://github.com/dc-js/dc.js/blob/develop/src/coordinate-grid-mixin.js#L1016). Please don't hesitate to ask on the dc.js users group if you try and can't get it working. Would be nice to include this in dc.js. – Gordon May 02 '16 at 12:35
  • Hi, did you find a solution for this ? – Dani Nov 25 '16 at 17:07
  • Unfortunately, No – felsher Nov 30 '16 at 13:56

0 Answers0