Have you already used the new Flash Charts in Oracle APEX 3.0?
As for SVG charts you can set them to Auto Refresh after x seconds. But it looks like that a small nice feature of the SVG charts is missing for the Flash charts. It doesn’t automatically show when the last refresh occurred.
But how can we add that?
At the first look it doesn’t seem to be that easy, because no full page refresh occurs, just the Flash chart is updated with an AJAX call.
But how can we intercept the apex_RefreshChart so that we can update a “Last Refresh” timestamp on the page?
It’s quite easy if you know how! 🙂
var vOldFunction = apex_RefreshChart;
you get a reference to the function apex_RefreshChart which you now can also call with vOldFunction. Nice, isn’t it? But what has this to do with the above problem?
It allows us replace the existing apex_RefreshChart with a new version where we do our additional stuff, but which also calls the original function to get the original functionality APEX provides to refresh the chart.
- Open the Region Definition of your Flash chart.
- Go to the Region Footer and add the following HTML code which will be a placeholder for “Last Refresh” timestamp.
<br> <center> Chart will refresh every 5 sec.<br> Last refresh: <span id="last_refresh"></span> </center>
What does it do?
Want to see an example? Visit my example page.