I'm trying to create multiple times series charts using DC.JS from one dataset with multiple dimensions
The problem I'm having is that each dimension has null values in them
date,value,#transactionLocalServiceperformancedashboard,Averagetimeonpage,Channelbreakdownfortransactions,Numberofuserenquiries,Pageviews,Reasonsforrejectedapplications,UniqueVisitors,"Userswhousetransaction,abandonoruselegacyroutewhenstartinganonlineapplication",Visits
05/02/17,1.2,,Average time on page,,,,,,,
05/02/17,105,For telephone,,Number of transactions phone,,,,,,
05/02/17,110,For post,,Number of transactions face to face,,,Number of incomplete,,Use legacy route,
05/02/17,165,For face to face,,Number of transactions online new transaction,,,,,Use new transaction,
05/02/17,178,,,,,,,Unique visitors,,
05/02/17,198,,,,,,,,,Visits
After lots and lots of searching I've come up with this jsfiddle
function remove_empty_bins(source_group) {
return {
all:function () {
return source_group.all().filter(function(d) {
return d.value !== "";
});
}
};
};
var coerce_row = function(d){
// console.log(d.VerifyLocalServiceperformancedashboard)
return {
time: d.date,
field: remove_empty_bins(d.VerifyLocalServiceperformancedashboard),
count: +d.count,
};
};
var dataset = data.map(coerce_row);
https://jsfiddle.net/zilnhoj/d8mqpyun/2/
I'm basically trying to filter out the nulls of each dimension and chart that dimension.
Is this possible with DC.JS or do I need to get a separate csv file for each dimension and load them in for each chart - I have the series chart working on a single dimension