In dc.js I have linked a heatmap with a bar chart. When a range is selected on the bar chart, the heatmap defaults to the first color in the color scheme instead of the gray deselected color. How can I get the heatmap to use the gray color?
Asked
Active
Viewed 241 times
0
-
Usually grey in DC.js is used to indicate the selection status, not the value zero. Do you mean that you want them to share a brush, so that a selection on the bar chart is the same as a selection on the heatmap? Or do you mean that you want zero to be colored grey? – Gordon Nov 14 '16 at 04:15
-
The Heat map has scale 0 to 100, with 0 showing as green and 100 as red. When I select some area in the bar chart, the unselected values default to 0 and end up showing as green on the heat map. In contrast, if I deselect an item on the heat map itself, the item turns gray. I'm trying to get items to turn grey (instead of green) when deselected via the bar chart. – Malcolm Nov 14 '16 at 13:05
-
Do you want any zeroes in the original unfiltered data to display as grey? – Gordon Nov 14 '16 at 14:52
-
I want original unfiltered zeroes to display as green. – Malcolm Nov 14 '16 at 19:14
1 Answers
1
The solution is to use a custom reduce function on the group. In so doing, I can set the value of a deselected item to null and then use an appropriate color for all null values.

Malcolm
- 99
- 1
- 5