dc-js / dc.js

Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js
Apache License 2.0
7.43k stars 1.8k forks source link

set brushing interval #455

Open cihadturhan opened 10 years ago

cihadturhan commented 10 years ago

Look at the bottom chart on this page for example.

I can use brush daily. How can I apply a brush round function so that brush will change interval 6 months. I want it discrete 6 month for example.

By the way, it's round function is not working or I'm missing something?

The snippet from there is

volumeChart.width(990)
        .height(40)
        .margins({top: 0, right: 50, bottom: 20, left: 40})
        .dimension(moveMonths)
        .group(volumeByMonthGroup)
        .centerBar(true)
        .gap(1)
        .x(d3.time.scale().domain([new Date(1985, 0, 1), new Date(2012, 11, 31)]))
        .round(d3.time.month.round) // here it says brush steps are monthly
        .xUnits(d3.time.months);

It says d3.time.month.round however I can brush it daily.

cihadturhan commented 10 years ago

I found the bug[feature] and submitted but my question still remains: How can I give a custom round function like 6 months interval instead of 1 month (.round(d3.time.month.round)) ?