# query data if (is_numeric($bucketsz)) { $sec = $bucketsz; } else { $sec = 60 * 60; // One hour } if ($DEBUG == TRUE) { echo "bucketsz:{$bucketsz}<br>\n"; echo "tstampF:{$tstampF} " . date('Y-m-d H:i:s', $tstampF) . "<br>\n"; echo "tstampT:{$tstampT} " . date('Y-m-d H:i:s', $tstampT) . "<br>\n"; echo "probeid:{$probeid}<br>\n"; } $startqd = getMicroTime(); $data = one_channel_data_query_ts($channel, $probeid, $sec, $tstampF, $tstampT); displayTimingInfo($startqd, getMicroTime(), $displayTiming, "query_data"); //probe_data_show_table($data); #print_r($data); if ($localdb == TRUE) { db_disconnect(); } $urldata['bucketsz'] = $bucketsz; $urldata['probeid'] = $probeid; $urldata['channel'] = $channel; /*** Data Points ***/ // Trick we add two datapoints, Start and End of the period we are plotting. $Dataset->addPoint($tstampF, 0); // Call data_addPoints() $records = data_addPoints01($Dataset, $data, $droptype, $maxy, $urldata); // End datapoint $Dataset->addPoint($tstampT, 0);
<?php ini_set('include_path', ini_get('include_path') . ':../:'); require_once "design.inc.php"; $title = "Probe overview"; doHeader($title, array('calender' => TRUE)); echo "<h1>{$title}</h1>"; require_once "functions.inc.php"; #$displayTiming = TRUE; $starttime = getMicroTime(); db_connect(); $probes = probes_info_query(); echo "\n<h4>Please select a probe:</h4>\n"; probes_info_form_tabel($probes, $probeid); # Trick incl the graph php script #include("../include/graph_probe_drops_bar01.php"); include "../include/graph_probe_drops_bar02.php"; include "../staging/pie01.php"; db_disconnect(); doFooter(); displayTimingInfo($starttime, getMicroTime(), $displayTiming, "php done");
$Fill->addColor('yellow', 'NODROPS'); $Plot->setFillStyle($Fill); // set a line color $Plot->setLineColor('darkred'); //set a standard fill style //$Plot->setFillColor('red@0.9'); $AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X); #$AxisX->setFontAngle(70); # # Needs auto adjustment $AxisX->setLabelOption('dateformat', "Y-m-d\nH:i:s"); #$AxisX->setLabelOption('dateformat', 'Y-m-d (\HH)'); #$AxisX->setLabelOption('dateformat', 'Y-m-d'); #$AxisX->setLabelInterval(200); // Fix the Y-axis max $AxisY =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_Y); if ($_REQUEST['maxy_fixed'] == "fixed") { if (is_numeric($max_y_value)) { $AxisY->forceMaximum($max_y_value); } } $filename = generateFilename("probe_drops_bar02", $_REQUEST, 'png'); // Special output the Graph $output = $Graph->done(array('tohtml' => True, 'showtime' => $displayTiming, 'border' => 0, 'filename' => $filename, 'filepath' => './graphs/', 'urlpath' => 'graphs/')); if ($records > 0) { print $output; } else { echo "<h3>Graph: No data available in choosen period</h3>"; } displayTimingInfo($startg, getMicroTime(), $displayTiming, "graph_bar02 done");