I have a d3 bar chart that lists data based on date in order by day. This works great, but now I need to display two sets of data per day, in a grouped bar chart format or just side-by-side bars.
I'm thinking this would take a bit of refactoring but after fooling with it and referencing a bunch of examples I've found on the net, the fact that the chart is using a timescale and linear scale throws a wrench in my understanding of this. I'm hoping someone can help show me the way into making this chart show 2 bars for each day in the chart.
My current x axis setup:
var xTimeScale = d3.time.scale().
domain([new Date(data[0].date), d3.time.day.offset(new Date(data[data.length - 1].date), 1)])
.range([0, width]);
var xScale = d3.scale.linear()
.domain([0, data.length])
.range([0, width]);
My fiddle: http://jsfiddle.net/MmEjF/45/
So from two separate sets of data, I need to have 2 bars per day - each bar representing a value from each data set. How can I accomplish displaying grouped bars? And would it be better if the datasets were combined into one?