Skip to content

Instantly share code, notes, and snippets.

@justnom
justnom / extend.js
Created January 21, 2013 22:29 — forked from pilate/extend.js
Extending the 'google.visualization.DataTable' prototype with toCSV
// Extend DataTable functionality to include toCSV
google.visualization.DataTable.prototype.toCSV = function () {
var dt_cols = this.getNumberOfColumns();
var dt_rows = this.getNumberOfRows();
var csv_cols = [];
var csv_out;
// Iterate columns
for (var i=0; i<dt_cols; i++) {