ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Auto Refresh the graph
Posted by Megha on Nov-17-2014 14:55
Hi

What is the code to auto refresh the graph after every 5 seconds without refreshing the
page.Is any function available in ChartDirector to do so.

  Re: Auto Refresh the graph
Posted by Peter Kwan on Nov-18-2014 02:33
Hi Megha,

There is a realtime chart sample code in ChartDirector that demonstrates how to
automatically refresh the graph every few seconds without refreshing the page. May be you
can use this as a reference.

In brief, the realtime chart sample code uses the ChartDirector Javascript method
JsChartViewer.streamUpdate can be used to update the graph without refreshing the page.
See:

http://www.advsofteng.com/doc/cdjava.htm#JsChartViewer.streamUpdate.htm

For the "every 5 seconds" part, you can use standard Javascript functions like
window.setInterval to configure code to run every 5 seconds. Please refer to Javascript
documentation on how to use this method. In the realtime chart sample code, this method
is used to run a subroutine periodically, and the subroutine calls
JsChartViewer.streamUpdate to update the chart.

Hope this can help.

Regards
Peter Kwan