Hello,
First off, dc.js rocks. Thanks for all of the great work in marrying d3 and crossfilter in such a lovely way. I'm new to dc.js and crossfilter, but have been using d3 for quite some time. I believe my question concerns dc, but perhaps my crossfilter group/reduce usage is to blame.
I have been working on some choropleth maps with associated charts for exploring data about emergency 'red alert' risks observed during labor that is aggregated by district in Rwanda. Here is an example:
http://bl.ocks.org/ewheeler/5354775 -- you'll need to click 'Open in a new window' to be able to scroll down and see all of the charts. Basically, the map and other charts are updated based on clicking the donut charts (provinces and risks) on the right-hand side.
My question: how can I color the sections of the stacked bar chart at the bottom to show the 'red alert' risks in the same color as in the corresponding donut chart?
I am able to color the provinces correctly in the bubble chart, but can't figure out how to do so for the elements of the stacked bar chart. The stacked bar chart doesn't seem to implement 'colors' in the same way as the other chart types. In the dc.js examples, stacked segments are colored with css, but in my case the risks vary per district, so each risk is not present for every district (hence the numbered css classes for the stacks are not consistent for each risk -- e.g., 'mother in labor at home' is given the class 'stack0' for Gakenke but it is given the class 'stack3' for Musanze). I tried to update the fill colors with pure d3 after the dc.renderAll() call, but i haven't been successful with that approach. Any ideas?
Thanks,
Evan