FusionCharts for Flex > Creating Widgets > Real-time Capabilities > Overview

Real-time gauges

Real-time gauges display only a single value (or multiple pointers with single value) in real-time. These are effective when you're just concerned with the current value of the monitored device, without any consideration for any historical values. For example, when you're monitoring temperature of a particular device and are only interested in the single value (i.e., the current temperature), the gauges are an ideal way to show that.
FusionWidgets v3 offers the following real-time gauges:

  • Real-time Angular
  • Real-time Bulb
  • Real-time Cylinder
  • Real-time Horizontal LED
  • Real-time Horizontal Linear
  • Real-time Thermometer
  • Real-time Vertical LED

Process flow

To setup a gauge with real-time update capabilities, the following steps need to be taken:

  1. Initialize the gauge with XML data. The gauge necessarily needs XML data to be initialized, as this XML contains the URL of the real-time data provider page (dataStreamURL) and the time interval for regular polling (to get new data).
  2. Setup your script at dataStreamURL to provide the real-time data in the required format. The format has been explained in next section. This data is called incremental data - as each time the gauge accesses this URL, the new data (on incremental basis) is provided to it.

    You can use any scripting language like ASP, .NET, ColdFusion, PHP, etc. to provide this incremental data, as the end data needs to be pure text and it doesn't matter to FusionWidgets where this data is coming from.

    However, make sure that the page provides the incremental update data to FusionWidgets that must be hosted on the same sub-domain in which the gauge SWF file is hosted - otherwise, FusionWidgets, owing to Flash Sandbox security model, won't be able to receive updated data. Due to Flash sandbox security restrictions, you are allowed to retrieve data only from the same sub-domain in which the flash movie is residing. Data can only be loaded from a domain that is an exact match to the location of the SWF, including subdomains. For this reason a SWF residing at server1.mydomain.com cannot access data from a SWF at mydomain.com.

    If you wish to load data from a different domain, you can set up a proxy page at the same sub-domain. It actually requests data from the distant domain and then relay it to FusionWidgets. You must be able to upload and run a server-side script on a server in the same domain as the Flash movie. In this method, the Flash movie accesses the script, which loads the information, retrieves it, and returns the information back to the Flash movie. This method is best if the server hosting the data is not under your control (for example, a public source or a web service).

  3. The gauge now constantly polls the given URL, reads the new data and updates itself.

Features offered by real-time widgets

The following features are exposed by real-time gauges in FusionWidgets with respect to real-time capabilities only:

  • In gauges, if you've multiple pointers with defined IDs, you can update the value either using the pointer/dial index or its value.
  • Real-time data can also be updated using Flex calls.
  • The real-time data accessed by the gauge can be retrieved using Flex calls.
  • You can stop the real-time update of any gauge either by sending a command from server, or by using the Flex API.
  • Context menu to help user to start and stop updates as and when he needs it. Additionally, you can opt to show/hide these menu items in the context menu.
  • In data-streaming gauges, you've the option to set different refresh, update, and clear interval.
  • In data-streaming gauges, you can clear the historical data shown on gauge by sending a command from server or using client side JavaScript.
  • Message Logger supported in all real-time widgets.
  • Alert Manager supported in all real-time widgets.