Time for action — retrieve CSV data from the chart and update a textarea
1. Create a copy of
SortChartData.html
in theJavaScriptCapabilities
folder and name it asRetrieveChartData.html
.2. Open this new file in a text editor and insert a new button that will appear just beside the button to sort data. The code for the button will be the following:
<input type="button" onclick=" fetchData()" value="Get Chart Data" />
3. After the end of the paragraph element (around line 86) containing the previous button, insert a new line and add the following HTML code:
<p> <textarea id="CSVData" style="display:none;" rows="8" cols="40" readonly="readonly" onblur="hideCSVData()"></textarea> </p>
4. Now within the
<head>
of the page, add a new line after the end of thesortData
function (around line number 48) and insert the following code:function fetchData () { var chart = FusionCharts("myChartId"), csvData = chart.getCSVData(), csvDataArea = document.getElementById...