FusionCharts API-Event: realtimeUpdateComplete
Created using FusionCharts Suite XT - www.fusioncharts.com
by FusionCharts
HTML
<script src="https://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="https://static.fusioncharts.com/code/latest/fusioncharts.charts.js"></script>
<!-- This sample shows the event parameters, and their values, when realtimeUpdateComplete event is triggered-->
<div id="indicatorDiv">Event name: <strong> realtimeUpdateComplete </strong>
<p>Triggered every time a real-time chart completes updating, using the dataStreamURL attribute or through user-interaction (using the edit mode of the real-time angular and linear gauges).</p>
<p>All events, when triggered, will provide two parameters for the handler - <strong> eventObj </strong> (object containing information generic to all events) and <strong> dataObj </strong> (object containing information specific to an event).</p>
<p>Scroll down to the table rendered below the chart to view information contained in the dataObj object. To view information contained in the eventObj object, open the console.</p>
<div id="chart-container">FusionCharts will render here</div>
<div>
<div>
<div id="header">
<div class="parameter-name">Parameter Name</div>
<div class="parameter-value">Parameter Value</div>
</div>
<div id="attrs-table"></div>
</div>
</div>
</div>
CSS
body {
padding: 5px;
margin: 0 auto;
}
strong {
font-weight: bold;
}
#header {
display: none;
}
#indicatorDiv {
width: 500px;
font-family:'Arial', 'Helvetica';
font-size: 14px;
}
p {
margin-top: 20px;
margin-bottom: 20px;
}
#attrs-table {
text-align: center;
margin: 15px 0;
}
.parameter-name, .parameter-value {
font-weight: bold;
text-align: center;
float: left;
}
.title, .value {
float:left;
width: 230px;
background: #fff;
padding: 5px 10px;
}
.title {
clear: left;
}
.title:nth-child(4n+1), .value:nth-child(4n+2) {
background: rgb(0, 117, 194);
color: #fff;
}
.value {
word-wrap: break-word;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
#tableCont {
margin: 15px 0;
}
JavaScript
FusionCharts.ready(function () {
var footfallChart = new FusionCharts({
id: "mychart",
type: 'realtimecolumn',
renderAt: 'chart-container',
width: '500',
height: '210',
dataFormat: 'json',
dataSource: {
"chart": {
"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 (evt, arg) {
var controllers = document.createElement('div');
controllers.setAttribute('id', 'tableCont');
controllers.innerHTML = "<div id='tableView' style='width:275px;margin-left:150px;height:110px;overflow-y:auto;display:none;'></div>";
//Display container div and write table
arg.container.parentNode.insertBefore(controllers,...