<?php // Graphs Package V2.1 16th March 2008 if (!file_exists("graphsconf.php")) { include "error_msg.php"; } include "graphsconf.php"; if (!file_exists($jploc . "jpgraph.php")) { $string = "Unable to find JPGraph files"; create_image1($string, $jploc); exit; } include $jploc . "jpgraph.php"; include $jploc . "jpgraph_line.php"; $clientraw = get_raw("{$hostloc}clientraw.txt"); // Create aray for y-axis $y = array(); $y = array($clientraw['80'], $clientraw['81'], $clientraw['82'], $clientraw['83'], $clientraw['84'], $clientraw['85'], $clientraw['86'], $clientraw['87'], $clientraw['88'], $clientraw['89']); $datay = $y; if ($speed_conv != 1) { array_walk($datay, "KtoV"); } //create timearray for the x-axis $crhour = $clientraw[29]; $crmin = $clientraw[30]; $crhour = $crhour - 1; if ($hourmode == "24") { if ($crhour == -1) { $crhour = 23; } $hr_pad = "0";
<?php // Graphs Package V2.1 16th March 2008 if (!file_exists("graphsconf.php")) { include "error_msg.php"; } include "graphsconf.php"; if (!file_exists($jploc . "jpgraph.php")) { $string = "Unable to find JPGraph files"; create_image1($string, $jploc); exit; } include $jploc . "jpgraph.php"; include $jploc . "jpgraph_bar.php"; $clientrawdaily = get_raw("{$hostloc}clientrawdaily.txt"); //Setup Y data $y = array(); $y = array($clientrawdaily['94'], $clientrawdaily['95'], $clientrawdaily['96'], $clientrawdaily['97'], $clientrawdaily['98'], $clientrawdaily['99'], $clientrawdaily['100'], $clientrawdaily['101'], $clientrawdaily['102'], $clientrawdaily['103'], $clientrawdaily['104'], $clientrawdaily['105'], $clientrawdaily['106'], $clientrawdaily['107'], $clientrawdaily['108'], $clientrawdaily['109'], $clientrawdaily['110'], $clientrawdaily['111'], $clientrawdaily['112'], $clientrawdaily['113'], $clientrawdaily['114'], $clientrawdaily['115'], $clientrawdaily['116'], $clientrawdaily['117'], $clientrawdaily['118'], $clientrawdaily['119'], $clientrawdaily['120'], $clientrawdaily['121'], $clientrawdaily['122'], $clientrawdaily['123'], $clientrawdaily['124']); $datay = $y; if ($pres_conv != 1) { array_walk($datay, "HtoI"); } //================================================================================================= //here we create the labels for the x-axis depending month and year //so if we are in March we must show the last day of Feb normally 28 or 29 and the following //label must be 01 //same for moths with 30 days (last day = 30 next label must be 01 and not 31 //we need 31 labels because we have 31 datapoints //================================================================================================== $month = date("m"); $year = date("y");
function get_date($rawfile) { global $hostloc; global $hourmode; $clientraw = get_raw("{$hostloc}clientraw.txt"); $rawdata = $clientraw[29]; $rawdata = $rawdata - 1; if ($hourmode == "24") { if ($rawdata == -1) { $rawdata = 23; } if ($rawdata < 10) { $rawdata = "0" . $rawdata; } } if ($hourmode == "12") { if ($rawdata >= 13) { $rawdata = $rawdata - 12; } if ($rawdata == -1) { $rawdata = 11; } if ($rawdata == 0) { $rawdata = 12; } } return $rawdata; }
<?php // Graphs Package V2.1 16th March 2008 if (!file_exists("graphsconf.php")) { include "error_msg.php"; } include "graphsconf.php"; if (!file_exists($jploc . "jpgraph.php")) { $string = "Unable to find JPGraph files"; create_image1($string, $jploc); exit; } include $jploc . "jpgraph.php"; include $jploc . "jpgraph_bar.php"; $clientrawextra = get_raw("{$hostloc}clientrawextra.txt"); $y = $clientrawextra['484'] + $clientrawextra['485'] + $clientrawextra['486'] + $clientrawextra['487'] + $clientrawextra['488'] + $clientrawextra['489'] + $clientrawextra['490']; $y = $y / 10; $y = array($y); $datay = $y; if ($rain_conv != 1) { array_walk($datay, "MtoI"); } // Setup the graph. $graph = new Graph($xsize1, $ysize, "auto"); $graph->SetScale("textlin"); $graph->yscale->SetGrace(10); $graph->SetMargin($lm1, $rm1, $tm1, $bm1); $graph->SetShadow(); $graph->SetMarginColor("{$margincolour}"); //Setup Mian Title $graph->title->SetFont(FF_ARIAL, FS_BOLD, 8);
<?php // Graphs Package V2.1 16th March 2008 if (!file_exists("graphsconf.php")) { include "error_msg.php"; } include "graphsconf.php"; if (!file_exists($jploc . "jpgraph.php")) { $string = "Unable to find JPGraph files"; create_image1($string, $jploc); exit; } include $jploc . "jpgraph.php"; include $jploc . "jpgraph_line.php"; $clientrawhour = get_raw("{$hostloc}clientrawhour.txt"); $process_hour = get_date("{$hostloc}clientrawhour.txt"); // Here we create an array of the values we need depending of the day of the week we are in (each month we shift to the left 1 place) $x = array(); $y = array(); $ii = 0; $jj = 1; while ($ii < 60) { $y[$ii] = $clientrawhour[$jj]; $ii = $ii + 1; $jj = $jj + 1; } $datay = $y; if ($speed_conv != 1) { array_walk($datay, "KtoV"); } //With this-one we calculate the labels for the x-axis