Accepted answer

i think you are running into this issue: elasticx for linear domain doesn't include the rightmost bar

(or a similar issue.)

dc.js takes its boundaries very literally, and it also computes them literally, so much that it doesn't take the width of its own bars into consideration.

one simple way to work around this is to add some padding:


since you are aggregating by month, this will make sure there is always a month to the left and right of the calculated domain (which will be of width 0 when there is only one bar).

of course, you will end up with that single bar filling the chart: big bar

so you might want to calculate the domain manually, in preredraw, until dc.js gets better at this.

fork of your fiddle:

Related Query

More Query from same tag