Giving Space in JSON

Created using FusionCharts Suite XT - www.fusioncharts.com

by Nabajeet Sonowal

HTML

<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.widgets.js"></script>
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<!-- A simple example of Gantt chart plotting the timeline of major tasks for construction of a new store (Just completed) in Denver. This is a comparison of how planned estimates fared against the actual and which tasks got delayed. 

Dynamic tooltip using macros to provide additional details on the chart elements.

Attribute:
    1. plottooltext (on chart node)
    2. tooltext (on individual task node)

Macros Used:
    1. $processName
    2. $label
    3. $start
    4. $end

Other available macros:
    1. $percentComplete
    2. $date
    3. $taskEndDate
    4. $taskStartDate
    5. $taskLabel
    6. $taskProcessComplete (etc)

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

JavaScript

FusionCharts.ready(function () {
    var chart = new FusionCharts({
        type: 'gantt',
        renderAt: 'chart-container',
        width: '600',
        height: '500',
        dataFormat: 'json',
        dataSource: {
            "chart": {
                "caption": "Construction management of a new store in Denver",
                "subcaption": "Planned vs Actual",                
                "dateformat": "dd/mm/yyyy",
                "outputdateformat": "ddds mns yy",
                "ganttwidthpercent": "70",
                "ganttPaneDuration": "50",
                "ganttPaneDurationUnit": "d",
                "plottooltext": "$processName{br} $label starting date $start{br}$label ending date $end",
                "theme": "fint"
            },
            "categories": [
                {
                    "bgcolor": "#33bdda",
                    "category": [
                        {
                            "start": "1/4/2014",
                            "end": "30/6/2014",
                            "label": "Months",
                            "align": "middle",
                            "fontcolor": "#ffffff",
                            "fontsize": "16"
                        }
                    ]
                },
                {
                    "bgcolor": "#33bdda",
                    "align": "middle",                                                        
                    "fontcolor": "#ffffff",
                    "fontsize": "16",
                    "category": [
                        {
                            "start": "1/4/2014",
                            "end": "30/4/2014",
                            "label": "April"                            
                        },
                        {
                            "start": "1/5/2014",
                            "end": "31/5/2014",
                            "label": "May"
                        },
                        {
        ...