I have a data table done by dc.js and crossfilter.js, and i want to export that table to CSV file..
dataTable.width(960).height(800)
.dimension(by_id)
.group(function(d) { return ""
})
.size(data.length)
.columns([
function(d) { return d.id; },
function(d) { return d.name; },
function(d) { return d.gender; },
function(d) { return parseFloat(d.GPA).toFixed(2); },
function(d) { return parseFloat(d.Major_GPA).toFixed(2); },
function(d) { return parseFloat(d.Math_GPA).toFixed(2); },
function(d) { return parseFloat(d.English_GPA).toFixed(2); },
function(d) { return parseFloat(d.Science_GPA).toFixed(2); },
function(d) { return parseFloat(d.Humanities_GPA).toFixed(2); }
])
.sortBy(function(d){ return d.id; })
.order(d3.ascending);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…