FusionCharts - Gallery Example - Real-time Line (Dual y-axis) Chart
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>
<!-- Real-time Column chart -->
<div id="chart-container">FusionCharts will render here</div>
JavaScript
FusionCharts.ready(function() {
var myChart = new FusionCharts({
type: 'realtimecolumn',
renderAt: 'chart-container',
width: '600',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Harry's Supermart - Bakersfield Central",
"subCaption": "Online Purchase",
"yaxismaxvalue": "10",
"numdisplaysets": "15",
"labeldisplay": "rotate",
"slantLabels": "1",
"showLegend": "0",
"showValues": "0",
"numbersuffix": " Transactions",
"showRealTimeValue": "0",
"theme": "fusion"
},
"categories": [{
"category": [{
"label": "8 mins ago"
}, {
"label": "7 mins ago"
}, {
"label": "6 mins ago"
}, {
"label": "5 mins ago"
}, {
"label": "4 mins ago"
}, {
"label": "3 mins ago"
}, {
"label": "2 mins ago"
}, {
"label": "1 min ago"
}]
}],
"dataset": [{
"seriesname": "",
"alpha": "100",
"data": [{
"value": "5"
}, {
"value": "7"
}, {
"value": "1"
}, {
"value": "5"
}, {
"value": "5"
}, {
"value": "2"
}, {
"value": "4"
}, {
"value": "3"
}]
}]
},
events: {
"rendered": function(evt, args) {
var chartRef = evt.sender,
//Format minutes, seconds by adding 0 prefix accordingly
formatTime = function(time) {
(time < 10) ? (time = "0" + time) : (time = time);
return time;
},
updateData = function() {
//We need to create a querystring format incremental update, containing
//label in hh:mm:ss format
//and a value (random).
var currDate = new Date(),
label =...