当前位置: 首页>>代码示例>>PHP>>正文


PHP Graph::title方法代码示例

本文整理汇总了PHP中Graph::title方法的典型用法代码示例。如果您正苦于以下问题:PHP Graph::title方法的具体用法?PHP Graph::title怎么用?PHP Graph::title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Graph的用法示例。


在下文中一共展示了Graph::title方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: departa

 function departa()
 {
     $this->load->library('Graph');
     $data = $titu = array();
     $mes = $this->uri->segment(4);
     $anio = $this->uri->segment(5);
     if (empty($mes) and empty($anio)) {
         return;
     }
     $fechai = $anio . $mes . '01';
     $fechaf = $anio . $mes . '31';
     //8471.49.00.00
     $mSQL = "SELECT f.descrip etiqueta, sum(b.importe) total\n\t\t\tFROM itscst b JOIN scst a ON a.control=b.control \n\t\t\tJOIN sinv c ON b.codigo=c.codigo\n\t\t\tJOIN grup d ON d.grupo=c.grupo\n\t\t\tJOIN line e ON d.linea=e.linea \n\t\t\tJOIN dpto f ON e.depto=f.depto \n\t\t\tWHERE a.tipo_doc IN ('FC', 'NC','NE') AND a.fecha>={$fechai} AND a.fecha<={$fechaf}\n\t\t\tGROUP BY f.depto";
     //echo $mSQL;
     $maxval = 0;
     $query = $this->db->query($mSQL);
     foreach ($query->result() as $row) {
         if ($row->total > $maxval) {
             $maxval = $row->total;
         }
         $data[] = $row->total;
         $titu[] = $row->etiqueta;
     }
     $i = 1;
     while (1) {
         if ($maxval / $i <= 100) {
             break;
         }
         $i = $i * 10;
     }
     $om = $i;
     $i = 0;
     //$om=1;
     for ($i = 0; $i < count($data); $i++) {
         $data[$i] = $data[$i] / $om;
     }
     $g = new Graph();
     if ($maxval > 0) {
         $g->title('COMPRAS DEL ' . $mes . '/' . $anio, '{font-size:18px; color: #d01f3c}');
         $g->set_data($data);
         $g->bar_glass(55, '#5E83BF', '#424581', 'Compras', 10);
         $g->set_y_max(ceil($maxval / $om));
         $g->y_label_steps(5);
         $g->set_x_labels($titu);
         $ejey = number_format($om, 0, '', ' ');
         $g->set_y_legend('Compras X ' . $ejey . ' (Bs)', 14, '0x639F45');
         $g->set_x_legend('Grupos ' . $mes, 14, '0x639F45');
         //$g->pie(60,'#505050','#000000');
         //$g->pie_values( $data, $titu );
         //$g->pie_slice_colours( array('#d01f3c','#356aa0','#C79810','#5E83BF'));
         $g->set_tool_tip('#key#<br>Departamento: #x_label# <br>Monto: #val# x ' . $ejey);
     } else {
         $g->title('NO EXISTEN VENTAS EN LA FECHA SELECCIONADA', '{font-size:18px; color: #d01f3c}');
     }
     $g->bg_colour = '#FFFFFF';
     //$g->set_bg_image(site_url('/images/ventafon.png'), 'center', 'middle' );
     echo $g->render();
     $query->free_result();
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:59,代码来源:analisis.php

示例2: grafico

 function grafico($mes = NULL, $anio = NULL)
 {
     if (empty($mes) and empty($anio)) {
         return;
     }
     $this->load->library('Graph');
     $titulo = $data_1 = $data_2 = $data_3 = $data_tips_1 = $data_tips_2 = $data_tips_3 = array();
     $fechai = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '01';
     $fechaf = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '31';
     $data = $this->_sincrodata($fechai, $fechaf);
     $om = 1;
     while ($this->maxval / $om > 100) {
         $om = $om * 10;
     }
     foreach ($data as $row) {
         $titulo[] = $row['dia'];
         $data_1[] = $row['contado'] / $om;
         $data_2[] = $row['credito'] / $om;
         $data_3[] = $row['cobrado'] / $om;
         $data_tips_1[] = graph::esc(number_format($row['contado'], 2, ',', '.'));
         $data_tips_2[] = graph::esc(number_format($row['credito'], 2, ',', '.'));
         $data_tips_3[] = graph::esc(number_format($row['cobrado'], 2, ',', '.'));
     }
     $odata_1 = new bar_fade(50, '0xCC3399');
     $odata_1->key('Contado', 10);
     $odata_1->data = $data_1;
     $odata_1->tips = $data_tips_1;
     $odata_2 = new bar_fade(50, '0x80a033');
     $odata_2->key('Cr&eacute;dito', 10);
     $odata_2->data = $data_2;
     $odata_2->tips = $data_tips_2;
     $odata_3 = new line_hollow(2, 3, '0x9933CC');
     $odata_3->key('Cobranzas a Cr&eacute;dito', 10);
     $odata_3->data = $data_3;
     $odata_3->tips = $data_tips_3;
     $g = new Graph();
     if ($this->maxval > 0) {
         $g->title('Ventas del mes ' . $mes . '/' . $anio, '{font-size:18px; color: #d01f3c}');
         $g->set_is_decimal_separator_comma(1);
         $g->data_sets[] = $odata_3;
         $g->data_sets[] = $odata_1;
         $g->data_sets[] = $odata_2;
         $g->set_y_max(ceil($this->maxval / $om));
         $g->y_label_steps(5);
         $g->set_x_labels($titulo);
         $ejey = number_format($om, 0, '', '.');
         $g->set_y_legend('Venta X ' . $ejey . ' (Bs)', 14, '0x639F45');
         $g->set_x_legend('D&iacute;as del mes ' . $mes, 14, '0x639F45');
         $g->set_tool_tip('#key#<br>D&iacute;a: #x_label# <br>Monto: #tip#');
     } else {
         $g->title('No existen ventas en la Fecha Seleccionada', '{font-size:18px; color: #d01f3c}');
     }
     $g->bg_colour = '#FFFFFF';
     //$g->set_bg_image(site_url('/images/ventafon.png'), 'center', 'middle' );
     echo utf8_encode($g->render());
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:56,代码来源:mensuales.php

示例3: grafico

 function grafico($anio = '')
 {
     if (empty($anio)) {
         return;
     }
     $this->load->library('Graph');
     $titulo = $data_1 = $data_2 = $data_3 = $data_tips_1 = $data_tips_2 = $data_tips_3 = array();
     $fechai = $anio . '0101';
     $fechaf = $anio . '1231';
     $data = $this->_sincrodata($fechai, $fechaf);
     $om = 1;
     while ($this->maxval / $om > 100) {
         $om = $om * 10;
     }
     //print_r($data);
     foreach ($data as $row) {
         $titulo[] = $row['mes'];
         $data_1[] = $row['contado'] / $om;
         $data_2[] = $row['credito'] / $om;
         $data_3[] = $row['cobrado'] / $om;
         $data_tips_1[] = graph::esc(number_format($row['contado'], 2, ',', '.'));
         $data_tips_2[] = graph::esc(number_format($row['credito'], 2, ',', '.'));
         $data_tips_3[] = graph::esc(number_format($row['cobrado'], 2, ',', '.'));
     }
     $odata_1 = new bar_fade(50, '0xCC3399');
     $odata_1->key('Contado', 10);
     $odata_1->data = $data_1;
     $odata_1->tips = $data_tips_1;
     $odata_2 = new bar_fade(50, '0x80a033');
     $odata_2->key('Cr&eacute;dito', 10);
     $odata_2->data = $data_2;
     $odata_2->tips = $data_tips_2;
     $odata_4 = new line_hollow(2, 3, '0x9933CC');
     $odata_4->key('Cobranzas a Cr&eacute;dito', 10);
     $odata_4->data = $data_3;
     $odata_4->tips = $data_tips_3;
     for ($i = 0; $i < count($data_1); $i++) {
         $mes = $i + 1;
         $odata_1->links[] = site_url("/hospitalidad/mensuales/index/{$mes}/{$anio}");
         $odata_2->links[] = site_url("/hospitalidad/mensuales/index/{$mes}/{$anio}");
         $odata_3->links[] = site_url("/hospitalidad/mensuales/index/{$mes}/{$anio}");
     }
     $g = new Graph();
     $g->set_is_decimal_separator_comma(1);
     if ($this->maxval > 0) {
         $g->title('Ventas en el a&ntilde;o ' . $anio, '{font-size:18px; color: #d01f3c}');
         $g->data_sets[] = $odata_1;
         $g->data_sets[] = $odata_2;
         $g->data_sets[] = $odata_4;
         $g->set_y_max(ceil($this->maxval / $om));
         $g->y_label_steps(5);
         $g->set_x_labels($titulo);
         $ejey = number_format($om, 0, '', ' ');
         $g->set_y_legend('Venta X ' . $ejey . ' (Bs)', 14, '0x639F45');
         $g->set_x_legend('Meses', 14, '0x639F45');
         $g->set_tool_tip('#key#<br>Mes: #x_label# <br>Monto: #tip#');
     } else {
         $g->title('NO existen ventas en el a&ntilde;o seleccionado', '{font-size:18px; color: #d01f3c}');
     }
     $g->bg_colour = '#FFFFFF';
     echo utf8_encode($g->render());
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:62,代码来源:anuales.php

示例4: grafico

 function grafico()
 {
     $this->load->library('Graph');
     $data = array();
     $dia = array();
     $mSQL = "SELECT if(b.tipo IS NULL,a.tipo,b.nombre) nombre, sum(a.monto*(SUBSTRING(a.numero,1,1)<>'X')) monto\n\t\t\t FROM viepag a LEFT JOIN tarjeta b ON a.tipo=b.tipo\n\t\t\t WHERE fecha BETWEEN 20070101 AND 20070131 \n\t\t\t GROUP BY a.tipo ORDER BY monto DESC";
     $res = $this->db->query($mSQL) or die("Bad SQL 1");
     $total = 0;
     foreach ($res->result() as $row) {
         if ($row->monto < 0) {
             $total += $row->monto * -1;
         } else {
             $total += $row->monto;
         }
     }
     $res->first_row();
     foreach ($res->result() as $row) {
         $titu[] = substr($row->nombre, 0, 20);
         if ($row->monto < 0) {
             $data[] = round($row->monto * 100 / $total * -1, 0);
         } else {
             $data[] = round($row->monto * 100 / $total, 0);
         }
     }
     // use the chart class to build the chart:
     $g = new Graph();
     $g->title('DISTRIBUCION DE LA COBRANZA ', '{font-size:18px; color: #d01f3c}');
     $g->set_data($data);
     $g->bar_filled(80, '#9933CC', '#8010A0', '', 10);
     $g->set_y_max(100);
     $g->bg_colour = '#FFFFFF';
     $g->y_label_steps(5);
     $g->set_x_labels($titu);
     $g->set_y_legend('Porcentaje de Venta', 14, '0x639F45');
     $g->set_x_legend('Forma de Pago', 14, '0x639F45');
     $g->set_bg_image(site_url('/images/ventafon.png'), 'center', 'middle');
     $g->set_tool_tip('#val#%25');
     echo $g->render();
     $res->free_result();
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:40,代码来源:supermercadosant.php


注:本文中的Graph::title方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。