예제 #1
0
 public function __user_agents_month($date)
 {
     $start_date;
     $start = date('Y-m-d H:i', strtotime($date['year'] . "-" . $date['month'] . "-01 00:00"));
     $final_date = $this->_plus_month($date);
     $end = date('Y-m-d H:i', strtotime($final_date['year'] . "-" . $final_date['month'] . "-01 00:00"));
     $html = "";
     $referrers = stats::user_agents($start, $end);
     $chart = new GoogChart();
     $dataMultiple = $referrers;
     /* # Chart 2 # */
     $chart->setChartAttrs(array('type' => 'pie', 'title' => 'User Agents for ' . date('F Y', strtotime($start)), 'data' => $dataMultiple, 'size' => array(750, 400), 'legend' => false, 'color' => array('#e127aa', '#27aae1')));
     // Print chart
     $html .= $chart;
     foreach ($referrers as $key => $val) {
         $html .= "<div><span style='float:right'>{$val}</span>{$key}</div>";
     }
     return $html;
 }
예제 #2
0
 public function reportecartera()
 {
     $this->AutoLoadLib(array('GoogChart', 'GoogChart.class'));
     $chart = new GoogChart();
     $color = array('#95b645', '#7498e9', '#999999');
     $dataMultiple = array('Año 2009' => array(XBox => 30, PS3 => 20, Wii => 45, Otros => 5), 'Año 2008' => array(XBox => 40, PS3 => 20, Wii => 30, Otros => 10));
     echo '<h2>MERCADO DE VIDEOJUEGOS</h2>';
     $chart->setChartAttrs(array('type' => 'pie', 'title' => 'Ventas: ' . $fecha, 'data' => $dataMultiple, 'size' => array(550, 300), 'color' => $color, 'labelsXY' => true));
     echo $chart;
 }
예제 #3
0
 public function unidadesAction()
 {
     //Conectamos a BBDD Condominio
     $sid = new Container('base');
     $db_name = $sid->offsetGet('dbNombre');
     $this->dbAdapter = $this->getServiceLocator()->get($db_name);
     //Instanticas
     $unid = new UnidadTable($this->dbAdapter);
     $bode = new BodegaTable($this->dbAdapter);
     $esta = new EstacionamientoTable($this->dbAdapter);
     //Consultamos tablas
     $unidades = $unid->getUnidades();
     $bodegas = $bode->getBodegas();
     $estacionamientos = $esta->getEstacionamientos();
     //Mostramos segun corresponda
     if (count($unidades) > 0 && count($bodegas) > 0 && count($estacionamientos) > 0) {
         $displaytablauni = "block";
         //GRAFICO
         $chart = new \GoogChart();
         // Data del Grafico
         $data = array('Deshabitados' => 17, 'Habitados' => 319);
         // Colores del Grafico
         $color = array('#999999', '#54C7C5', '#428bca');
         /* # Grafico 1 # */
         $chart->setChartAttrs(array('type' => 'pie', 'title' => 'Ocupacion de Dptos', 'data' => $data, 'size' => array(300, 150), 'color' => $color));
         //Cargamos combos
         $combo1 = $unid->getDatosActivos();
     } else {
         $displaytablauni = "none";
     }
     if (count($bodegas) > 0) {
         $displaybodegas = "none";
     } else {
         $displaybodegas = "block";
     }
     if (count($estacionamientos) > 0) {
         $displayestacionamientos = "none";
     } else {
         $displayestacionamientos = "block";
     }
     if (count($unidades) > 0) {
         $displayunidades = "none";
     } else {
         $displayunidades = "block";
     }
     $result = new ViewModel(array('valores' => $valores, 'displaytablauni' => $displaytablauni, 'displaybodegas' => $displaybodegas, 'displayestacionamientos' => $displayestacionamientos, 'displayunidades' => $displayunidades, 'chart' => $chart));
     $result->setTerminal(true);
     return $result;
 }
예제 #4
0
<div style="width: 730px; margin: 20px auto; font-family:sans-serif;">
<?php 
/** Include class */
include 'GoogChart.class.php';
/** Create chart */
$chart = new GoogChart();
/*
		Example 1
		Pie chart
*/
// Set graph data
$data = array('IE7' => 22, 'IE6' => 30.7, 'IE5' => 1.7, 'Firefox' => 36.5, 'Mozilla' => 1.1, 'Safari' => 2, 'Opera' => 1.4);
// Set graph colors
$color = array('#99C754', '#54C7C5', '#999999');
/* # Chart 1 # */
echo '<h2>Pie chart</h2>';
$chart->setChartAttrs(array('type' => 'pie', 'title' => 'Browser market 2008', 'data' => $data, 'size' => array(400, 300), 'color' => $color));
// Print chart
echo $chart;
/*
		Example 2
		Bar graph
		Multiple data
*/
// Set multiple graph data
$dataMultiple = array('February 2008' => array('IE7' => 22, 'IE6' => 30.7, 'IE5' => 1.7, 'Firefox' => 36.5, 'Mozilla' => 1.1, 'Safari' => 2, 'Opera' => 1.4), 'January 2008' => array('IE7' => 22, 'IE6' => 30.7, 'IE5' => 1.7, 'Firefox' => 36.5, 'Mozilla' => 1.1, 'Safari' => 2, 'Opera' => 1.4));
/* # Chart 2 # */
echo '<h2>Vertical Bar</h2>';
$chart->setChartAttrs(array('type' => 'bar-vertical', 'title' => 'Browser market 2008', 'data' => $dataMultiple, 'size' => array(550, 200), 'color' => $color, 'labelsXY' => true));
// Print chart
echo $chart;