Exemple #1
0
    $data[3]['value'] = 563;
    $data[4]['title'] = '23 May 2010 10:30am';
    $data[4]['value'] = 195;
    */
    /******************************************************************************/
    ?>
			
				<div id="main">
				  <div class="caption"><?php 
    echo $result_std['first_name'] . '&nbsp;' . $result_std['last_name'];
    ?>
 [ Performance Chart]</div>
				  <div id="icon">&nbsp;</div>
				  <div id="result">
					 <?php 
    drawChart($data);
    ?>
				  </div>   
				   <div id="source">Xaminer Reports v3.2</div>
				</div>
			</body>   		
			<br>
			
            
      </td>
       </tr>
      </table>
             </td>
  </tr>
</table>
                              
$res = $db->sql_query($query);
if ($res <= 0) {
    echo "no log entries found<br>";
    return;
}
$data_time = array();
$hitsArray = array();
$sessionsArray = array();
$visitorsArray = array();
while ($row = mysql_fetch_assoc($res)) {
    array_push($data_time, $row['op']);
    array_push($hitsArray, $row['num']);
    array_push($sessionsArray, sprintf("%.5f", $row['meanTime']));
    array_push($visitorsArray, sprintf("%.5f", $row['maxTime']));
}
drawChart(0, "Page", $data_time, array(array("val_array" => $hitsArray, "color" => "orange", "legend" => "Hits"), array("val_array" => $sessionsArray, "color" => "blue", "legend" => "Mean time"), array("val_array" => $visitorsArray, "color" => "green", "legend" => "Max time")));
function drawChart($chartNum, $legend, $legendarray, $args)
{
    global $moduleRelPath;
    $graph = new Graph(600, 230, "auto");
    $graph->SetScale("textlin");
    $graph->SetMarginColor("#C8C8D4");
    $graph->title->Set($title);
    $graph->xaxis->SetTextTickInterval(1);
    $graph->xaxis->SetTextLabelInterval(1);
    $graph->xaxis->SetTickLabels($legendarray);
    $graph->xaxis->SetPos("min");
    $graph->xaxis->SetLabelAngle(90);
    $graph->xaxis->SetTextLabelInterval(1);
    $graph->xgrid->Show();
    $graph->xgrid->SetLineStyle('dashed');
Exemple #3
0
    $y[$player][] = $elo;
    $allx[] = $idx;
    $ally[] = $elo;
}
// Standard inclusions
include "pChart/pData.class";
include "pChart/pChart.class";
// Dataset definition
$DataSet = new pData();
$DataSet->AddPoint($allx, "allx");
$DataSet->AddSerie("allx");
$DataSet->AddPoint($ally, "ally");
$DataSet->AddSerie("ally");
foreach ($names as $name) {
    $DataSet->AddPoint($x[$name], $name . "x");
    $DataSet->AddSerie($name . "x");
    $DataSet->AddPoint($y[$name], $name . "y");
    $DataSet->AddSerie($name . "y");
}
//$DataSet->SetYAxisName("ELO");
//$DataSet->SetXAxisName("Game");
$colors = array();
$ratio = 0;
$gold = 0.618033988749895;
for ($i = 0; $i < count($names); $i++) {
    $ratio += $gold;
    $ratio = $ratio % 1;
    $colors[] = fGetRGB($i / count($names) * 360, 95, 95);
}
drawChart($title, $DataSet, $names, $colors);
Exemple #4
0
require 'graphfunc.php';
$name = $_GET['name'];
preg_replace("/[^A-Za-z0-9 ]/", '', $name);
$db = DB::connect("mysql://*****:*****@localhost/games");
$sql = "select games.date, elo.elo from elo inner join games on games.gameid = elo.gameid where elo.name = '{$name}' order by elo.eloid asc";
$q = $db->query($sql);
$date = array();
$val = array();
$year = 0;
while ($q->fetchInto($row)) {
    if ($year != toYStr($row[0])) {
        $date[] = toYStr($row[0]);
    } else {
        $date[] = "";
    }
    $year = toYStr($row[0]);
    $val[] = $row[1];
}
// Standard inclusions
include "pChart/pData.class";
include "pChart/pChart.class";
// Dataset definition
$DataSet = new pData();
$DataSet->AddPoint($val, "Serie1");
$DataSet->AddPoint($date, "Serie2");
$DataSet->AddSerie("Serie1");
$DataSet->SetAbsciseLabelSerie("Serie2");
$DataSet->SetYAxisName("ELO");
$DataSet->SetXAxisName("Game");
drawChart($title, $DataSet, "line", array(array(255, 0, 0)));
Exemple #5
0
        } else {
            $rotate = false;
        }
        drawChart('Månedsfordelt - antall bookinger', 'month', false, false, $rotate);
        break;
    case 'year-people':
        $dataset = new jmData();
        $dataset->importArray($stats_year);
        $dataset->setPeople();
        drawChart('Årsfordelt - antall barn og voksne', 'year', true);
        break;
    case 'year-entries':
        $dataset = new jmData();
        $dataset->importArray($stats_year);
        $dataset->setEntries();
        drawChart('Årsfordelt - antall bookinger', 'year', false);
        break;
    default:
        echo 'Ingen graftype definert.';
        exit;
}
echo 'ok - ' . $filename;
function drawChart($tittel, $what, $people = true, $childrenonly = false, $rotate = false)
{
    global $time, $dataset, $filename, $chart_path;
    // Initialise the graph
    if (!$rotate) {
        $Test = new pChart(700, 230);
    } else {
        $Test = new pChart(700, 330);
    }
$data[4]['title'] = $day[5];
$data[4]['value'] = $value[5];
$data[5]['title'] = $day[6];
$data[5]['value'] = $value[6];
$data[6]['title'] = $day[0];
$data[6]['value'] = $value[7];
$t = $lang["statistic_title"];
$v = $lang["statistic_value"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
   <title>Micro Bar Chart</title>
   <link href="style/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="main">
      <div class="caption"><?php 
echo $lang["statistic_daily_traffic"];
?>
</div>
      <div id="icon">&nbsp;</div>
      <div id="result">
         <?php 
drawChart($data, $t, $v);
?>
      </div>   
	   <div id="source">Micro Bar Chart 1.0</div>
    </div>
</body>