$image->setItemData($x, $x_label); } break; } $image->enable("ItemData"); # Upper and lower indices and scale step $image->setY($upper_limit + 0.0001, 0, ceil($upper_limit / 5)); ############################################################# # How many data values do we have: # 24 hrs = 1440 min / collection interval ie. # 1440 / 15 mins = 96 values # I want to show legend only every 2 hours ie. 12 points ############################################################# $image->paintXY(); # Axis legend $image->paintScale("Time", "Number of licenses", "FF_FONT1"); # Graph color $image->setGraphcolor(100, 100, 200); $image->paintData(); ################################################################################ # We will now draw a line that indicates the number of available licenses ie. # at the top of the graph we will draw a solid line ################################################################################ # Clear the data from the bar graph $image->clearData(); $image->setDiagramType("Line"); $image->setData(0, $upper_limit); $image->setData($i, $upper_limit); $image->setGraphcolor(255, 0, 0); $image->paintData(); ################################################################################
for ($i = 0; $i <= $upper_limit; $i++) { if (isset($data[$i])) { $image->setData($i + 1, $data[$i]); } else { $image->setData($i + 1, 0); } $image->setItemData($i + 1, $i); } $image->enable("ItemData"); $image->setX($i + 1.0E-5, 0, ceil($upper_limit / 15)); # Upper and lower indices and scale step $image->setY(max($data) + 1.0E-5, 0, (int) (100 * max($data) / 5) / 100); # $image->paintXY(); # Axis legend $image->paintScale("Licenses used", "Time used in hours", 1); # Graph color $image->setGraphcolor(100, 200, 100); $image->paintData(); if (isset($_GET['debug'])) { print "SQL: " . $sql . "\n"; echo "If following array is empty your license utilization table is not\n being populated. Most common problem is that license_util.php script is not\n being run periodically ie. every 15 minutes.<p><PRE>"; print_r($image->m_data); exit; } else { Header("Content-type: image/png"); } $image->show(); } else { ################################################################ # First let's get license usage for the product specified in $feature