0

I have a set of data that looks like this

event_name, open_date, closed_date
JOBAPPLICATON, 1-jun-2014, 4-jun-2014
JOBAPPLICATON, 3-jun-2014, 4-jun-2014
JOBAPPLICATON, 1-jun-2014, 14-jun-2014
...

I would like to plot these in a bar chart with a time scale, in such a way that the open_date is grouped and counted (as a red bar), and the closed_date is grouped and counted (as a blue bar). Ideally, these bars are next-to-each-other.

I achieved some success by combining them in a composedChart as two separate barcharts, but is that the best way? Or are there better approaches?

Rob Audenaerde
  • 19,195
  • 10
  • 76
  • 121

1 Answers1

1

I've used the composed chart in this manner before.

It worked for me because I needed two bars (revenue and cost) for the past year. It would've been harder if I had a dynamic number of bars or if the time frame would've been variable.

Here is a writeup of that approach: Multi-series bar chart in DC-js

Community
  • 1
  • 1
DJ Martin
  • 2,579
  • 20
  • 24
  • Yeah, dc.js doesn't really support bar series charts / grouped bar charts yet. This composite approach is the best I know so far. – Gordon Jul 17 '14 at 05:18
  • The composed charts have some weird issues with margins though. – Rob Audenaerde Jul 17 '14 at 10:42
  • If you can use a fixed time scale (I used one year) and a fixed number of series (I had two) then you should be able to manage the margins. – DJ Martin Jul 17 '14 at 11:41