samedi 29 novembre 2014

Can I export my Dygraph data as a single object to a CSV file?


I dynamically generate a Dygraph chart with data retrieved and formatted using a PHP script.



var vGraph = new Dygraph(document.getElementById("dgraphChartContainer"),
"./data_packager.php",
{ //options
...
};


My customer wants me to add a button on the Dygraph to download a CSV file of the complete raw data set returned by the PHP query. Is there a single Dygraph object I can reference of the entire RxC matrix? If not, is there a simpler or more efficient way to recreate the CSV than to perform a .getValue on each element in the data set and then export to a new CSV file per one of the solutions in How to export JavaScript array info to csv (on client side)??





Aucun commentaire:

Enregistrer un commentaire