FusionCharts - Changing Chart Type

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>
<!-- Changing chart type dynamically. FusionCharts allows you to change its chart type dynamically through its advance API. 

Method :

 - chartType() : Invoke the method on any FusionCharts' instance and provide the chart name as argument. -->

<div id="chart-container">FusionCharts will render here</div>

<div id='controllers'>
    <label><input name='chart-type' id='line' type='radio' value='line' /> Line chart</label>    
    <label><input name='chart-type' id='bar' type='radio' value='bar2d' /> Bar chart</label>   
    <label><input name='chart-type' id='column' type='radio' value='column2d' checked='true' /> Column chart</label>
    
</div>

CSS

body{
    font-family: 'Helvetica Neue', Arial;
    font-size: 14px;
    font-weight: normal;
}
input[type=text] {
    max-width: 50px;
}
#controllers {
    position: inherit;
    width: 500px;
    padding: 0 140px;
}

#controllers label{
    padding: 0 5px;
}

JavaScript

FusionCharts.ready(function () {
    var radio = [],
        radElem,
        val,
        revenueChart = new FusionCharts({
            type: 'column2d',
            renderAt: 'chart-container',
            width: '500',
            height: '400',
            dataFormat: 'json',
            dataSource: {
                "chart": {
                    "caption": "Monthly revenue",
                    "subCaption": "Last year",
                    "xAxisName": "Month",
                    "yAxisName": "Revenue (In USD)",
                    "numberPrefix": "$",
                    "theme": "fint"
                },

                "data": [
                    {
                        "label": "Jan",
                        "value": "420000"
                    }, 
                    {
                        "label": "Feb",
                        "value": "810000"
                    },
                    {
                        "label": "Mar",
                        "value": "720000"
                    },
                    {
                        "label": "Apr",
                        "value": "550000"
                    },
                    {
                        "label": "May",
                        "value": "910000"
                    },
                    {
                        "label": "Jun",
                        "value": "510000"
                    },
                    {
                        "label": "Jul",
                        "value": "680000"
                    },
                    {
                        "label": "Aug",
                        "value": "620000"
                    },
                    {
                        "label": "Sep",
                        "value": "610000"
                    },
                    {
                        "label": "Oct",
                        "value": "490000"
                    },
                    {
                        "label": "Nov",
               ...