Live monitoring charts on a web page
I want to make my web page live or interactive like having monitoring or analysis kind of thing, on refreshing data periodically..
For example, go开发者_JAVA百科ogle's speedtracer..
There are many api's like jFreeChart to draw a static chart, but i want it like to refresh periodically, there is an option to perform it by polling but that would effect the look of the site and also it gets time consuming operation to get effect reflected to user.
Is it possible to do on a web page using javascript or jQuery or any api's available?
Thanks..
Take a look at flot. It leverages the canvas tag to render great looking graphs client side. It is way better performing than the server side rendering of JFreeChart.
google's chart api might be useful
im working on a stats page for a system im developing, whilst i call the page refresh using php theres no reason you cant do something like this for your page refresh:
<!-- Codes by Quackit.com -->
<html>
<head>
<script type="text/JavaScript">
<!--
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
// -->
</script>
</head>
<body onload="JavaScript:timedRefresh(5000);">
<p>This page will refresh every 5 seconds. This is because we're using the 'onload' event to call our function. We are passing in the value '5000', which equals 5 seconds.</p>
<p>But hey, try not to annoy your users too much with unnecessary page refreshes every few seconds!</p>
</body>
</html>
As for a js charting options, ive worked with Basic Js CHarts to get going but moving into the world of Sencha Sencha Touch Charts, these guys seem great, amazing library that work on mobile devices, and also came across this mind blowing data visualization library
Hope this helps :-)
精彩评论