Real-time support | ||||||||||||
The gauges in FusionWidgets XT pack are real time gauges that can continuously request new data from the server and display the same, without involving any page refreshes. You can specify the URL of the data provider and the time interval (in seconds), after which the gauge will look for new data. The data provider page needs to be a page at your server-side, which when invoked by linear gauge, will output the new data in the format explained below. |
||||||||||||
Real-time data format | ||||||||||||
The real-time data format for gauges depends on:
Let's quickly see examples of each one of them. |
||||||||||||
Data value update | ||||||||||||
In the simplest form, if you're looking to update the value of a gauge, you need to output the data in following format: &value=34 Here, the output is a single value, 34. So, when FusionWidgets XT will read this value, it will update the chart by setting its value to 34 (if the data is within range). |
||||||||||||
Stopping real-time updates from server | ||||||||||||
If you wish to stop the chart from polling the server for any more real-time updates, you can send the following command from server to do so: &stopUpdate=1 After stopping the update, it can be restarted either using user interaction (right click context menu) or using client-side JavaScript. |
||||||||||||
Sending messages pertinent to Message logger | ||||||||||||
The gauge can show message logger like data streaming charts. There are various parameters which you can specify for message logger. All of them have been explained in the Message Logger section. | ||||||||||||
Creating the real-time gauge | ||||||||||||
To create any real-time gauge, you'll need to assimilate the following things:
We're already familiar with XML for the chart. The new attributes that need to be added for real-time update are: |
||||||||||||
|
||||||||||||
Shown below is an example chart XML: |
||||||||||||
<chart lowerLimit="0" upperLimit="100" lowerLimitDisplay="Bad" upperLimitDisplay="Good" palette="1" numberSuffix="%" chartRightMargin="20" decimals="0" dataStreamURL="RealTimeData.asp" refreshInterval="3"> { "chart": { "lowerlimit": "0", "upperlimit": "100", "lowerlimitdisplay": "Bad", "upperlimitdisplay": "Good", "palette": "1", "numbersuffix": "%", "chartrightmargin": "20", "decimals": "0", "datastreamurl": "RealTimeData.asp", "refreshinterval": "3" }, "colorrange": { "color": [ { "minvalue": "0", "maxvalue": "75", "code": "FF654F", "label": "Bad" }, { "minvalue": "75", "maxvalue": "90", "code": "F6BD0F", "label": "Moderate" }, { "minvalue": "90", "maxvalue": "100", "code": "8BBA00", "label": "Good" } ] }, "value": "43", "styles": { "definition": [ { "type": "font", "name": "myValueFont", "bgcolor": "F1f1f1", "bordercolor": "999999" } ], "application": [ { "toobject": "Value", "styles": "myValueFont" } ] } } |
||||||||||||
Here, we've set dataStreamURL='RealTimeData.asp' refreshInterval='3', which tells the chart to poll new data from RealTimeData.asp every 3 seconds. For the sake of demo, RealTimeData.asp returns random value within 100% in the format: &value=84 When this value is read by the gauge, it will update its display to reflect the updated value. |
||||||||||||
Troubleshooting | ||||||||||||
|