Example #1
0
<?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();
Example #2
0
if ($conn->connect_error) {
    die("Database Connectivity Error! Please report to admin." . $conn->connect_error);
}
$dataArray = array();
$hold1 = 0;
$hold2 = 0;
$arg1 = $_GET["month1"] . $_GET["year1"];
$sql = "SELECT `TktsBkd` FROM actualdata WHERE `id`= {$arg1}";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        $hold1 = $row["TktsBkd"];
    }
}
$arg2 = $_GET["month2"] . $_GET["year2"];
$sql = "SELECT `TktsBkd` FROM actualdata WHERE `id`= {$arg2}";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        $hold2 = $row["TktsBkd"];
    }
}
$data = array("April" => $hold1, "May" => $hold2);
$graph->setBackgroundColor("#B2B09B");
$graph->addData($data);
$graph->setBarColor("#FF6F59", "#43AA8B");
$graph->setBarOutlineColor("#43AA8B");
$graph->setTitle("Test Scores");
$graph->setTextColor("#FFFCDD");
$graph->setBarOutlineColor("#72C4FF");
$graph->createGraph();