I have plotted some graphs using d3.js. In d3.tsv function I have passed a URL to a php script that performs some query on database and returns output to the client in TSV format.
e.g.:
d3.tsv("getData.php", function(error, data) {
data.forEach(function(d) {
d.date = parseDate(d.date);
d.close = +d.close;
});
Is there some way to put a download button along with plotting graph so that when user clicks on the button, the data gets downloaded in a file at client side without making request to "getData.php" again. In other words, I don't want to fetch data again from the server. Instead I want to use data that was fetched previously while plotting the graph.
Thank you in advance for your valuable advice(s).