FusionCharts - Combination 2D Chart with dual y-axis in JavaScript
Created using FusionCharts Suite XT - www.fusioncharts.com
by Vishalika
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>
<div id="chart-container">FusionCharts will render here</div>
<!-- Sample for : Combination Charts. Combination charts can plot column, area and line in a single chart. This sample is showing Revenue, Profit and Profit percentage comparison in same canvas area. As Revenue and Profit both are amount related, these two are shown in primary y axis whereas Profit Percentage is plotted on the secondary axis. Chart used: Combination 2D Chart with dual y-axis. -->
JavaScript
FusionCharts.ready(function () {
var revenueChart = new FusionCharts({
type: 'mscombidy2d',
renderAt: 'chart-container',
width: '550',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Revenues and Profits",
"subCaption": "For last year",
"xAxisname": "Month",
"pYAxisName": "Amount (In USD)",
"sYAxisName": "Profit %",
"showPlotBorder":"0",
"numberPrefix": "$",
"drawanchors":"0",
"sNumberSuffix" : "%",
"sYAxisMaxValue" : "50",
"theme": "fint"
},
"categories": [{
"category": [{
"label": "Jan"
}, {
"label": "Feb"
}, {
"label": "Mar"
}, {
"label": "Apr"
}, {
"label": "May"
}, {
"label": "Jun"
}, {
"label": "Jul"
}, {
"label": "Aug"
}, {
"label": "Sep"
}, {
"label": "Oct"
}, {
"label": "Nov"
}, {
"label": "Dec"
}]
}],
"dataset": [{
"seriesName": "Revenues",
"renderAs": "area",
"showValues": "0",
"plotBorderThickness":"3",
"showPlotBorder":"1",
"plotBorderColor":"#9304ec ",
"data": [{
"value": "16000"
}, {
"value": "20000"
}, {
"value": "18000"
}, {
...