Added download image to the chart element in SVG format (line/bar graphs).
Once image is clicked, exportCSV(ele) is executed. A simple function gets chart data from memory using an existing function in monkshu components and calls utils.exportCSV().
Created a file utils.mjs in chart-box/lib - to maintain common utility functions.
exportCSV() in utils, simply takes contents and filename as parameters, then process the data from JSON to CSV format and - download it within the function itself.
Papaparse library added to parse data with commas and newline character(delimiters).
Added blob to the link element and removed it at the end of the function call.
P.S: Changes have been modified as per comment in PR #29. Tested locally with data that has a comma or newline character.
PR #32 Reload Papaparse at once is fixed with PR.
Implemented Export CSV feature
P.S: Changes have been modified as per comment in PR #29. Tested locally with data that has a comma or newline character. PR #32 Reload Papaparse at once is fixed with PR.