FusionCharts - Stacked Column 2D Chart in JavaScript
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>
<!-- Showing the Cumulative Sum of stacked data in Stacked Column Chart. This sample is showing product category wise revenue for current year using Stacked Column 2D Chart.
# showSum - Set to 1
-->
<div id="chart-container">FusionCharts will render here</div>
JavaScript
FusionCharts.ready(function() {
var revenueChart = new FusionCharts({
type: "stackedcolumn2d",
renderAt: "chart-container",
width: "500",
height: "300",
dataFormat: "json",
dataSource: {
"chart": {
"theme":"fint",
"caption": "Revenue split by product category",
"subCaption": "For current year",
"xAxisname": "Quarter",
//Showing the Cumulative Sum of stacked data
"showSum": "1",
//"numberPrefix": "$",
"formatNumberScale": '1',
"numberScaleValue": '60',
"numberScaleUnit": ' :',
"scaleSeparator": "",
"decimals": '2',
"forceDecimals": '1',
"scaleRecursively": '1',
// "forceDecimals": '1',
"decimalSeparator": ' : ',
"maxScaleRecursion": '-1',
"adjustdiv": '0',
"numdivlines": '5'
},
"categories": [{
"category": [{
"label": "Q1"
}, {
"label": "Q2"
}, {
"label": "Q3"
}, {
"label": "Q4"
}]
}],
"dataset": [{
"seriesname": "Food Products",
"data": [{
"value": "11000"
}, {
"value": "15000"
}, {
"value": "13500"
}, {
"value": "15000"
}]
}, {
"seriesname": "Non-Food Products",
"data": [{
"value": "11400"
}, {
"value": "18702"
}, {
"value": "8300"
}, {
"value": "11800"
}]
}]
}
}).render();
});