FusionCharts - Gallery Example - Scroll Column 2D Chart in JavaScript
Created using FusionCharts Suite XT - www.fusioncharts.com
by FusionCharts
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>
<!--
A Scroll Column 2D Chart showing sales trend for last two years.
-->
<div id="container">FusionCharts will render here</div>
JavaScript
FusionCharts.ready(function() {
var topStores = new FusionCharts({
type: 'stackedarea2dlinedy',
renderAt: 'container',
width: '550',
height: '500',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Energy Data for consumption vs. Price ",
"subCaption": "2010-2014",
"xAxisname": "Year",
"pYAxisName": "Total consumption-in billion BTU",
"sYAxisName": "Price-in USD per million BTU",
"sNumberSuffix": "M",
"theme": "fusion",
"showanchors": "0",
},
"categories": [{
"category": [{
"label": "2010"
},
{
"label": "2011"
},
{
"label": "2012"
},
{
"label": "2013"
},
{
"label": "2014"
}
]
}],
"dataset": [{
"seriesname": "Coal",
"data": [{
"value": "41656762"
},
{
"value": "39327714"
},
{
"value": "34761848"
},
{
"value": "36077545"
},
{
"value": "35993151"
}
]
},
{
"seriesname": "Electricity",
"data": [{
"value": "25623035"
},
{
"value": "25588952"
},
{
"value": "25212289"
},
{
"value": "25418495"
},
{
"value": "25690310"
}
]
},
{
"seriesname": "Natural Gas",
"data": [{
"value": "49267013"
},
{
"value": "50029967"
},
{
"value": "52276699"
},
{
"value": "53716269"
},
{
...