FusionCharts - Gallery Example - Stacked Bar 2D
Created using FusionCharts Suite XT - www.fusioncharts.com
by Saneesh K V
HTML
<script src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.js"></script>
<script src="https://cdn.fusioncharts.com/fusioncharts/latest/themes/fusioncharts.theme.fusion.js"></script>
<!-- Stacked Bar 2D chart showing product wise quarterly revenue for the current year. -->
<div id="chart-container">FusionCharts will render here</div>
JavaScript
FusionCharts.ready(function() {
var revenueChart = new FusionCharts({
type: 'stackedbar2d',
renderAt: 'chart-container',
width: '450',
height: '400',
dataFormat: 'json',
dataSource: {
"chart": {
"theme": "fusion",
"caption": "Product-wise quarterly revenue in current year",
"subCaption": "Harry's SuperMart",
"xAxisname": "Quarter",
"yAxisName": "Revenue (In USD)",
"numberPrefix": "$",
"paletteColors": "#0075c2,#1aaf5d",
"bgColor": "#ffffff",
"borderAlpha": "50",
"showCanvasBorder": "0",
"usePlotGradientColor": "0",
"plotBorderAlpha": "10",
"legendBorderAlpha": "0",
"legendShadow": "0",
"valueFontColor": "#ffffff",
"showXAxisLine": "1",
"xAxisLineColor": "#999999",
"divlineColor": "#999999",
"divLineIsDashed": "1",
"showAlternateVGridColor": "0",
"subcaptionFontBold": "0",
"subcaptionFontSize": "14",
"showHoverEffect": "1",
"maxBarHeight": "50",
plotspacepercent: 50,
},
"categories": [{
"category": [{
"label": "Q1"
},
{
"label": "Q4"
}
]
}],
"dataset": [{
"seriesname": "Food Products",
"data": [{
"value": "121000"
},
{
"value": "135000"
},
{
"value": "123500"
},
{
"value": "145000"
}
]
},
{
"seriesname": "Non-Food Products",
"data": [{
"value": "131400"
},
{
"value": "154800"
},
{
"value": "98300"
},
{
"value": "131800"
}
]
}
]
}
}).render();
});