FusionCharts - Gallery Example - Real-time Stacked Column Chart in Javascript.

Created using FusionCharts Suite XT - www.fusioncharts.com

by Ashok Kumaresan

HTML

<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.charts.js"></script>
<!-- 
    Real-time stacked column chart no. of  live visitors on site, updated every 5 seconds
-->
<div id="chart-container">FusionCharts will render here</div>

JavaScript

FusionCharts.ready(function () {
    var stockPriceChart = new FusionCharts({
        id: "stackRealTimeChart",
        type: 'realtimestackedcolumn',
        renderAt: 'chart-container',
        width: '500',
        height: '300',
        dataFormat: 'json',
        dataSource: {
            "chart": {
                "caption": "Live Visitors on Site",
                "subCaption": "Every 5 seconds",
                "xAxisName": "Time",
                "yAxisName": "No. of visitors",
                "refreshinterval": "5",
                "numberSuffix":"s",
                "yaxisminvalue": "0",
                "yaxismaxvalue": "60",
                "numdisplaysets": "10",               
                "showValues": "1",
                "showRealTimeValue": "0",
                "labelDisplay":"NONE",
                //Cosmetics
               "slantLabels":"1",
                "paletteColors" : "#0075c2,#1aaf5d",
                "baseFontColor" : "#333333",
                "baseFont" : "Helvetica Neue,Arial",
               
                "usePlotGradientColor" :"0",
            
                "valueFontColor" : "#000000",
                "placeValuesInside" : "1",


            },
            "categories": [
                {
                    "category": [
                        { "label": "Day Start" }
                    ]
                }
            ],
           "dataset": [
                {
                    "seriesName" : "clothing.hsm.com",
                    "data": [
                        { "value": "12" }
                    ]
                },
                {
                    "seriesName" : "food.hsm.com",
                    "data": [
                        { "value": "20" }
                    ]
                },
                 {
                    "seriesName" : "travel.hsm.com",
                    "data": [
                        { "value": "15" }
                    ]
                }
            ]
        },
   ...