FusionCharts - Column 2D Chart in JavaScript
Created using FusionCharts Suite XT - www.fusioncharts.com
by sanjuktamukherjee
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>
<!--
A simple Column 2D chart showing monthly revenue of Harry's SuperMart for last year.
-->
<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": {
"xaxisname": "Months",
"yaxisname": "Sales",
"caption": "Cumulative Sales",
"subcaption": "(From Dec-03 to Dec-04)",
"showvalues": "0",
"showborder": "0",
"plotGradientColor": ""
},
"categories": [
{
"category": [
{
"label": "Dec-03",
"showlabel": "1"
},
{
"label": "Jan-04",
"showlabel": "0"
},
{
"label": "Feb-04",
"showlabel": "1"
},
{
"label": "Mar-04",
"showlabel": "0"
},
{
"label": "Apr-04",
"showlabel": "1"
},
{
"label": "May-04",
"showlabel": "0"
},
{
"label": "Jun-04",
"showlabel": "1"
},
{
"label": "Jul-04",
"showlabel": "0"
},
{
"label": "Aug-04",
"showlabel": "1"
},
{
"label": "Sep-04",
"showlabel": "0"
},
{
"label": "Oct-04",
"showlabel": "1"
},
{
"label": "Nov-04",
"showlabel": "0"
},
{
"label": "Dec-04",
"showlabel": "1"
}
]
}
],
"dataset": [
{
"seriesname": "Product4",
"color": "7CB5EC",
"data": [
{
"value": "100"
},
{
"value": "30"
},
{
"value": "220"
},
{
"value": "40"
},
{
"value": "150"
},
{
"value": "60"
},
{
"value": "80"
},
{
"value": "100"
},
...