From 9228de6c4d231ab1325014e8341f5d0f981a0af0 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 11 Oct 2010 17:10:35 -0400 Subject: Fix graph staggering, the old method was causing the graphs to diverge in update intervals over time. --- usr/local/www/graph.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr/local/www/graph.php') diff --git a/usr/local/www/graph.php b/usr/local/www/graph.php index 964c2c7..14af862 100755 --- a/usr/local/www/graph.php +++ b/usr/local/www/graph.php @@ -61,6 +61,11 @@ if ($_GET["timeint"]) else $time_interval = 3; +if ($_GET["initdelay"]) + $init_delay = $_GET["initdelay"]; //Initial Delay +else + $init_delay = 3; + //SVG attributes $attribs['axis']='fill="black" stroke="black"'; $attribs['in']='fill="#FF0000" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="7"'; @@ -229,13 +234,13 @@ function plot_data(obj) { last_ugmt = ugmt; last_ifin = ifin; last_ifout = ifout; - + var graphTimerId = 0; switch (plot_in.length) { case 0: SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'visible'); plot_in[0] = diff_ifin / diff_ugmt; plot_out[0] = diff_ifout / diff_ugmt; - setTimeout('fetch_data()',); + setTimeout('fetch_data()',); return; case 1: SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'hidden'); -- cgit v1.1