I've been having trouble finding the best way to solve a visualisation issue I'm having with dc.js.
My example is a situation I have data something like
[
{
type:'human"
age:4
orderArrived:1
},
{
type:"human"
age:10,
orderArrived:2
},
{
type:"dog"
age:10,
orderArrived:3
},
{
type:"dog"
age:14
orderArrived:4
}
etc etc
]
Now I'd like to visualise the dogs and humans based on age category. Say three categories <3 , >=3 <=6, >6.
I 'd also like to have one line chart which shows the age of the entity on the y-axis and order arrived on the x-axis (this part I have no problem with).
I'd also like a donut graph counting the number of entities of any type with each age category (I can also do this with no problem).
The part I am having trouble with is providing another two donut charts showing age category separated by species. So one donut showing the count of only dogs in each age category and another showing the count of only humans in each age category. I'm sure the answer is obvious, and I'm missing something simple, but it wasn't clear to me how to achieve the grouping by age category and making it specific to the species. I had a few hacks that almost worked by using reduceSum and ignoring the items of the other category, but I seemed to have trouble with consistent behaviour when clicking on donut segments and reseting filters.
Regards,
Richard.