FusionCharts - Testing new export server
Created using FusionCharts Suite XT - www.fusioncharts.com
by Ritesh Pandey
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>
<!--Changing the chart size dynamically through FusionCharts API (resizeTo method) -->
<div id="chart-container">FusionCharts will render here</div>
<div id='controllers'>
<label for='width'>Width</label>
<input id='width' type='text' value='550' />
<label for='height'>Height</label>
<input id='height' type='text' value='350' />
<input id='change' class='resizebtn' type='Button' value='Resize' />
</div>
CSS
input[type=text] {
max-width: 50px;
font-family: Verdana, sans;
font-size: 13px;
font-style: normal;
font-weight: normal;
}
#controllers {
position: inherit;
left: 10px;
font-family: Verdana, sans;
font-size: 13px;
font-style: normal;
font-weight: bold;
}
.resizebtn {
font-family: Verdana, sans;
font-size: 14px;
font-style: normal;
}
JavaScript
FusionCharts.ready(function () {
var iniWidth = 500,
iniHeight = 300,
widthInput = document.getElementById('width'),
heightInput = document.getElementById('height'),
changeBtn = document.getElementById('change'),
setDimensionOnClick = function () {
var w = parseInt(widthInput.value, 10) || iniWidth,
h = parseInt(heightInput.value, 10) || iniHeight;
if (w && h) {
revenueChart.resizeTo(w, h);
}
},
revenueChart = new FusionCharts({
type: 'column2d',
renderAt: 'chart-container',
width: iniWidth,
height: iniHeight,
dataFormat: 'json',
dataSource: {
"chart": {
"exportEnabled": 1,
"exportHandler": "http://54.235.200.97",
"caption": "Monthly revenue",
"subCaption": "Last year",
"xAxisName": "Month",
"yAxisName": "Amount ($)",
"numberPrefix": "$",
"theme": "fint"
},
"data": [
{
"label": "Jan",
"value": "420000"
},
{
"label": "Feb",
"value": "810000"
},
{
"label": "Mar",
"value": "720000"
},
{
"label": "Apr",
"value": "550000"
},
{
"label": "May",
"value": "910000"
},
{
"label": "Jun",
"value": "510000"
},
{
...