I've looked at dc.js's documentation carefully, and noticed some open issues surrounding multi-series line charts.
I have data that looks like this:
var data = [
//['time', 'text', 'temperature', 'count'],
['1379952000', 'field_1', 91, 56],
['1379952000', 'field_2', 50, 20],
['1379952000', 'field_3', 88, 24],
['1379952000', 'field_4', 50, 37],
['1379953200', 'field_1', 97, 58],
['1379953200', 'field_2', 84, 86],
['1379953200', 'field_3', 85, 62],
['1379953200', 'field_4', 88, 73]
// etc.
];
Once it's added to crossfilter, I'd like to make a line chart that has 4 lines: one for each value of the "text" field (i.e. "field_1", "field_2", "field_3", "field_4"). This thread suggests that such a thing is possible. Following the advice here I came up with the code in this gist.
I can't quite figure out how to separate the data series into 4 separate lines. I've tried using filter
on the data but I keep ending up with one series that seems to just have all of the points in it.
You can view a live example of the code here: http://bl.ocks.org/jsundram/6690354
Any help would be much appreciated.
Update: working code is here: http://bl.ocks.org/jsundram/6728956