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({
id: "mychart-2",
type: 'realtimecolumn',
renderAt: 'chart-container',
width: '600',
height: '210',
dataFormat: 'json',
dataSource: {
"chart": {
"theme": "fusion",
"caption": "Harry's Supermart - Bakersfield Central",
"subCaption": "Footfalls",
"showrealtimevalue": "1",
"paletteColors": "#008ee4,#9b59b6",
"borderAlpha": "0",
"yaxismaxvalue": "20",
"numdisplaysets": "10",
"usePlotGradientColor": "0",
"plotBorderAlpha": "0",
"canvasBorderAlpha": "20",
"labeldisplay": "rotate",
"slantLabels": "1",
"showLegend": "0",
"bgAlpha": "0",
"showValues": "0",
"numbersuffix": " Customers",
"showlabels": "1",
"animation": "0",
"showRealTimeValue": "0"
},
"categories": [{
"category": [{
"label": "Start"
}]
}],
"dataset": [{
"seriesname": "Footfall",
"alpha": "100",
"data": [{
"value": "5"
}]
}]
},
"events": {
"beforeRender": function(evtObj, argObj) {
var controllers = document.createElement('div');
// Create div
controllers.innerHTML = '<div><input type="button" style="margin-left:5px;margin-top:5px" value="Get Data" id="getdata_btn" style="margin-left:5px;margin-top:5px" /></div><div id="tableView" style="width:275px;height:75px;overflow-y:auto; display:none;border: none;margin: 3px"></div>';
//Display container div and write table
argObj.container.parentNode.insertBefore(controllers, argObj.container.nextSibling);
},
"rendered": function(evtObj, argObj) {
//Format minutes, seconds by adding 0 prefix accordingly
function formatTime(time) {
return (time < 10) ? (time = "0" + time) : (time = time);
}
function...