I am using dc.js to make a simple dashboard. My data is composed of five columns, date
, node
,type
, variable
and value
. It combines resource monitoring data and events. They are defined in the variable column, under categories cpu, hd, int, mem and event. The type column is NA for resources and a certain string detailing the type of event. And the value column corresponds to the number of that certain resource in a certain moment or 1 if that row corresponds to an event.
Having said that, I want to plot a scatter plot with the date on the x axis and the presence or not of an event in the y axis, but I've not yet managed to do it. And I fear it has to do with an incorrect understanding of crossfilter. I'm fairly confident on how to code dimension, I have this:
var eventDim = ndx2.dimension(function(d){
if (d.variable=="event"){
return [d.Date.getTime(),d.type];
}
});
But I can't grasp on how to create the group to do what I want and what valueAccessor I have to pass as a parameter to the scatter plot to plot what I want.
Any help would be appreciated.
Thanks in advance.