FusionCharts - Getting Base64 String for Chart
Created using FusionCharts Suite XT - www.fusioncharts.com
by Gagan Sikri
HTML
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<center>
<div id="chart-container">FusionCharts will render here</div>
<hr>
<button id="get"><b>Get Base64 String</b>
</button>
<br><br>
<div id="text">The chart SVG string is given below:
<br><br>
<div id="msg" align="left"></div>
<br><hr><br>
The chart Base64 string is given below:
<br><br>
<div id="msgbase64" align="left"></div>
</div>
</center>
CSS
body {
padding: 5px;
margin: 0 auto;
}
#indicatorDiv {
width: 500px;
font-family: 'Arial', 'Helvetica';
font-size: 13px;
}
#text {
font-family: 'Arial', 'Helvetica';
font-size: 13px;
}
#msg {
height: 50px;
overflow: auto;
}
#msgbase64 {
height: 50px;
overflow: auto;
}
#get {
height: 25px;
font-size: 13px;
}
JavaScript
FusionCharts.ready(function() {
var visitChart = new FusionCharts({
type: 'msline',
renderAt: 'chart-container',
width: '100%',
asyncRender: '0',
height: '350',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Number of visitors last week",
"subCaption": "Bakersfield Central vs Los Angeles Topanga",
"theme": "fint",
"captionFontSize": "13",
"subcaptionFontSize": "12",
"showValues": "0"
},
"categories": [{
"category": [{
"label": "Mon"
}, {
"label": "Tue"
}, {
"label": "Wed"
}, {
"vline": "true",
"lineposition": "0",
"color": "#6baa01",
"labelHAlign": "center",
"labelPosition": "0",
"label": "National holiday",
"dashed": "1"
}, {
"label": "Thu"
}, {
"label": "Fri"
}, {
"label": "Sat"
}, {
"label": "Sun"
}]
}],
"dataset": [{
"seriesname": "Bakersfield Central",
"data": [{
"value": "15123"
}, {
"value": "14233"
}, {
"value": "25507"
}, {
"value": "9110"
}, {
"value": "15529"
}, {
"value": "20803"
}, {
"value": "19202"
}]
}, {
"seriesname": "Los Angeles Topanga",
"data": [{
"value": "13400"
}, {
"value": "12800"
}, {
"value": "22800"
}, {
"value": "12400"
}, {
"value": "15800"
}, {
"value": "19800"
}, {
"value": "21800"
}]
}],
"trendlines": [{
"line": [{
"startvalue": "17022",
"color": "#6baa01",
"valueOnRight": "1",
"displayvalue": "Average"
}]
}]
}
}).render();
function...