예제 #1
0
<?php

/*********************************************************************
    chart.php

    Configuring and creating report chart. Use the PHPGraphLib library.

    Copyright (c)  2012-2014 Katak Support
    http://www.katak-support.com/
    
    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    $Id: $
**********************************************************************/
include "../include/lib/phpgraphlib.php";
// receive data
$data = unserialize(urldecode(stripslashes($_GET['mydata'])));
// instantiate the graph
$graph = new PHPGraphLib(570, 380);
//configure graph
$graph->addData($data);
$graph->setTitle("Tickets per month");
$graph->setGradient("black", "lime");
$graph->setBarOutlineColor("black");
$graph->setDataValues(TRUE);
$graph->setYValues(false);
$graph->createGraph();
예제 #2
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();
예제 #3
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();