FusionCharts API-Methods: getCSVData
Created using FusionCharts Suite XT - www.fusioncharts.com
HTML
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.charts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<!-- This sample shows the usage of the getCSVData() method -->
<div id="indicatorDiv">Method Name: <b>getCSVData()</b>
<br>
<br>Fetch chart data set in the CSV format. The data returned is the closest possible comma-separated value representation that has been provided to the chart. The exported data does not contain any functional or cosmetic attribute that was set on the chart.
<br>Click <b>Get CSV Data</b> to the chart CSV data.</br>
</div>
<br>
<center>
<br>
<button id="get_csv_data">Get CSV Data</button>
</br>
<br>
<div id="csv_data"><i>The CSV data is shown here.</i>
</div>
</br>
<div id="chart-container">FusionCharts will render here</div>
</center>
CSS
body {
padding: 5px;
margin: 0 auto;
}
#indicatorDiv {
width: 500px;
font-family: 'Arial', 'Helvetica';
font-size: 13px;
}
#csv_data {
height: 100px;
overflow: auto;
font-family: 'Arial', 'Helvetica';
font-size: 13px;
}
#get_csv_data {
height: 25px;
font-size: 13px;
}
JavaScript
FusionCharts.ready(function() {
var revenueChart = new FusionCharts({
"dataSource": {
"dataset": [{
"seriesName": "Client Cost",
"data": [{
"toolText": "<div>$label: $dataValue<\/div>",
"value": 65351.36
}, {
"toolText": "<div>$label: $dataValue<\/div>",
"value": 35347.97
}, {
"toolText": "<div>$label: $dataValue<\/div>",
"value": 32885.56
}, {
"toolText": "<div>$label: $dataValue<\/div>",
"value": 2382.55
}]
}, {
"renderAs": "line",
"seriesName": "Leads",
"data": [{
"toolText": "<span>$label: <\/span>310",
"value": 309.8233384999999
}, {
"toolText": "<span>$label: <\/span>186",
"value": 185.79077180000004
}, {
"toolText": "<span>$label: <\/span>151",
"value": 151.20040259999993
}, {
"toolText": "<span>$label: <\/span>7",
"value": 7.185487
}],
"parentYAxis": "s",
"showValues": 0
}],
"chart": {
"anchorRadius": 4,
"pYAxisName": "Client Cost (AUD)",
"xAxisName": "Sales House",
"subCaption": "By Sales House",
"exportDataFormattedVal": 1,
"theme": "native,whitelabel",
"formatNumber": 1,
"sDecimals": 0,
"caption": "Client Cost / Leads",
"drawAnchors": 1,
"exportEnabled": 1,
"decimalSeparator": ".",
"formatNumberScale": 0,
"decimals": 0,
"thousandSeparator": ",",
"numVisiblePlot": 4,
"scrollShowButtons": 1,
"sYAxisName": "Leads",
"numberSuffix": " AUD",
"showValues": 1
},
"categories": [{
"category": [{
"label": "TEN NETWORK"
}, {
"label":...