sistemazione grafici
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
<?php
|
||||
include_once ("../core/config.php");
|
||||
$UTENTE = login();
|
||||
//$UTENTE = login();
|
||||
//isadmin();
|
||||
|
||||
include_once "../jpgraph/jpgraph.php";
|
||||
include_once "../jpgraph/jpgraph_bar.php";
|
||||
//include_once "../jpgraph/jpgraph_line.php";
|
||||
//include_once "../jpgraph/jpgraph_plotline.php";
|
||||
//include_once( "../jpgraph/jpgraph_date.php" );
|
||||
include_once "../jpgraph/jpgraph_bar.php";
|
||||
|
||||
|
||||
//$ip = $dato['ip'];
|
||||
if (isset ($_GET['ip'])) $ip = $_GET['ip'];
|
||||
if (isset ($_GET['tempo'])) $tempo = $_GET['tempo'];
|
||||
|
||||
|
||||
switch ($tempo) {
|
||||
case 'DAY':
|
||||
$gruppo = "HOUR";
|
||||
@@ -80,6 +81,8 @@ while ( list ($tempo, $scritta, $inviati, $ricevuti) = mysql_fetch_array($res))
|
||||
if (!isset ($tmp['inv'][$tempo]) ) $tmp['inv'][$tempo] = $inviati;
|
||||
if (!isset ($tmp['ric'][$tempo]) ) $tmp['ric'][$tempo] = $ricevuti;
|
||||
if (!isset ($tmp['tag'][$tempo]) ) $tmp['tag'][$tempo] = $scritta;
|
||||
if (!isset ($tmp['txtR'][$tempo]) ) $tmp['txtR'][$tempo] = "Ricevuti: $ricevuti";
|
||||
if (!isset ($tmp['txtI'][$tempo]) ) $tmp['txtI'][$tempo] = "Inviati: $inviati";
|
||||
};
|
||||
|
||||
//print_r($xdata); exit;
|
||||
@@ -89,6 +92,9 @@ foreach ($xdata as $key => $val) {
|
||||
$ydata['inv'][] = $tmp['inv'][$val];
|
||||
$ydata['ric'][] = $tmp['ric'][$val];
|
||||
$ydata['tag'][] = $tmp['tag'][$val];
|
||||
$ydata['dst'][] = "#";
|
||||
$ydata['txtR'][] = $tmp['txtR'][$val];
|
||||
$ydata['txtI'][] = $tmp['txtI'][$val];
|
||||
}
|
||||
|
||||
//print_r($ydata); exit;
|
||||
@@ -107,20 +113,20 @@ $g->legend->Pos(0.05,0.1);
|
||||
$b1plot = new BarPlot ( $ydata['inv'] );
|
||||
$b2plot = new BarPlot ( $ydata['ric'] );
|
||||
$gbplot = new GroupBarPlot (array( $b1plot , $b2plot ));
|
||||
//$gbplot = new AccBarPlot (array( $b1plot , $b2plot ));
|
||||
$g->Add ( $gbplot );
|
||||
|
||||
|
||||
$b1plot->SetFillColor('red');
|
||||
$b1plot->SetShadow('gray',0.8);
|
||||
$b1plot->SetLegend("Inviati");
|
||||
$b1plot->SetCSIMTargets($ydata['dst'],$ydata['txtI']);
|
||||
|
||||
$b2plot->SetFillColor('blue');
|
||||
$b2plot->SetShadow('gray',0.8);
|
||||
$b2plot->SetLegend("Ricevuti");
|
||||
$b2plot->SetCSIMTargets($ydata['dst'],$ydata['txtR']);
|
||||
|
||||
$g->xaxis->SetTickLabels($ydata['tag']);
|
||||
|
||||
|
||||
|
||||
//$g->StrokeCSIM('graph.php','');
|
||||
$g->Stroke();
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user