<?php include '../phpgraphlib.php'; $graph = new PHPGraphLib(350, 280); $data = array("Roger" => 145, "Ralph" => 102, "Rhonda" => 123, "Ronaldo" => 137, "Rosario" => 149, "Robin" => 99, "Robert" => 88, "Rustof" => 111); $graph->setBackgroundColor("black"); $graph->addData($data); $graph->setBarColor('255, 255, 204'); $graph->setTitle('IQ Scores'); $graph->setTitleColor('yellow'); $graph->setupYAxis(12, 'yellow'); $graph->setupXAxis(20, 'yellow'); $graph->setGrid(false); $graph->setGradient('silver', 'gray'); $graph->setBarOutlineColor('white'); $graph->setTextColor('white'); $graph->setDataPoints(true); $graph->setDataPointColor('yellow'); $graph->setLine(true); $graph->setLineColor('yellow'); $graph->createGraph();
<?php include '../phpgraphlib.php'; $graph = new PHPGraphLib(450, 300); $data = array("Jan" => -10.1, "Feb" => -3.6, "Mar" => 11.0, "Apr" => 30.7, "May" => 48.6, "Jun" => 59.8, "Jul" => 62.5, "Aug" => 56.8, "Sep" => 45.5, "Oct" => 25.1, "Nov" => 2.7, "Dec" => -6.5); $graph->addData($data); $graph->setBarColor('navy'); $graph->setupXAxis(20, 'blue'); $graph->setTitle('Average Temperature by Month, in Fairbanks Alaska'); $graph->setTitleColor('blue'); $graph->setGridColor('153,204,255'); $graph->setDataValues(true); $graph->setDataValueColor('navy'); $graph->setDataFormat('degrees'); $graph->setGoalLine('32'); $graph->setGoalLineColor('red'); $graph->createGraph();
$hl = $XAxisLength * 6; $h = $hl + 200; //entered as % of graph width/height $YAxisLength = 100 * $wl / $w; $XAxisLength = 100 * $hl / $h; /* echo '<pre>'; print_r(array( 'GET' => $_GET, 'from' => $from, 'num' => $num, 'totalNum' => $totalNum, 'labels' => $labels, 'values' => $values, 'data' => $data, 'w' => $w, 'h' => $h, 'YAxisLength' => $YAxisLength, 'XAxisLength' => $XAxisLength, )); echo '</pre>'; exit; */ include "phpgraphlib.php"; $graph = new PHPGraphLib($w, $h); $graph->addData($data); $graph->setTitle($title); $graph->setupXAxis($XAxisLength, "black"); $graph->setupYAxis($YAxisLength, "black"); $graph->setGradient("156,189,225", "19,92,184"); $graph->createGraph();
<?php include 'phpgraphlib.php'; $graph = new PHPGraphLib(350, 280); $data = array("Day1" => 0.5, "Day2" => 0, "Day3" => 0.5, "Day4" => 0, "Day5" => 0.5, "Day6" => 0, "Day7" => 1, "Day8" => 0, "Day9" => 2.5); //$graph->setBackgroundColor("black"); $graph->addData($data); $graph->setBarColor('255,255,204'); $graph->setTitle('Workout Summary'); $graph->setTitleColor('black'); $graph->setupYAxis(15, 'black'); $graph->setupXAxis(20, 'black'); $graph->setGrid(false); $graph->setGradient('blue', 'white'); $graph->setBarOutlineColor('white'); $graph->setTextColor('black'); $graph->setDataPoints(true); $graph->setDataPointColor('red'); $graph->setLine(true); $graph->setLineColor('red'); $graph->createGraph();
<?php include '../phpgraphlib.php'; $graph = new PHPGraphLib(520, 280); $data = array("Alpha" => 1145, "Beta" => 1202, "Cappa" => 1523, "Delta" => 1437, "Echo" => 949, "Falcon" => 999, "Gamma" => 1188); $data2 = array("Alpha" => 898, "Beta" => 1498, "Cappa" => 1343, "Delta" => 1345, "Echo" => 1045, "Falcon" => 1343, "Gamma" => 987); $graph->addData($data, $data2); $graph->setBarColor('blue', 'green'); $graph->setTitle('Company Production'); $graph->setupYAxis(12, 'blue'); $graph->setupXAxis(20); $graph->setGrid(false); $graph->setLegend(true); $graph->setTitleLocation('left'); $graph->setTitleColor('blue'); $graph->setLegendOutlineColor('white'); $graph->setLegendTitle('Week-37', 'Week-38'); $graph->setXValuesHorizontal(true); $graph->createGraph();
break; case 'memuse': $graph = new PHPGraphLib(800, 450, "./result-" . date("Ymd") . "/memory-usage.png"); $graph->addData($rsm['memuse']); $graph->setTitle("Memory Usage (KB)"); break; case 'files': $graph = new PHPGraphLib(800, 450, "./result-" . date("Ymd") . "/number-of-files.png"); $graph->addData($rsm['files']); $graph->setTitle("Number of files been included or required"); break; case 'funcal': $graph = new PHPGraphLib(800, 450, "./result-" . date("Ymd") . "/number-of-function-calls.png"); $graph->addData($rsm['funcal']); $graph->setTitle("Number fo function calls"); break; case 'time': $graph = new PHPGraphLib(800, 450, "./result-" . date("Ymd") . "/response-time.png"); $graph->addData($rsm['time']); $graph->setTitle("Response Time (Millisecond)"); break; default: continue; } $graph->setTitleLocation('left'); $graph->setBarColor('255,102,51'); $graph->setDataValues(true); $graph->setXValuesHorizontal(true); $graph->setupXAxis(20, ''); $graph->createGraph(); }