You are viewing documentation for an older version. For current documentation - click here.

In our previous examples, we have seen how to specify refreshInterval for the chart by setting it in XML/JSON data. Every n seconds (specified as refreshInterval), the chart polls the server, retrieves new data and updates itself.

FusionWidgets XT data streaming charts also allow you to set different update and refresh interval for the chart.

Update interval indicates the polling interval when data is retrieved from server and queued for update, but not applied on chart. Refresh interval means application of this queued data on the chart, i.e., the chart is re-drawn to show all updated data contained in its queue.

An example

Let us consider a case where you are showing the real-time CPU usage using line chart. Here, you want the chart to fetch updated data every 5 seconds, but want to refresh its view state (drawing) every 30 seconds only. To do so, you can set:

<chart ... updateInterval='5' refreshInterval='30' ...>
{
  "chart": {
  ...
  "updateInterval" : "5",
  "refreshInterval" : "30",
  },
  }

The above attributes instruct the chart to keep fetching new data every 5 seconds. However, the new data is not applied on the chart every 5 seconds. Instead, it's stored in the chart data storage.

After every 30 seconds, the chart is refreshed with historical data and the new data that has been collected over the past 30 seconds.

This method helps you save a lot of resources when you do not want to miss regular updates, but also do not want to strain the end user's machine by refreshing the chart at such a small interval.