本文整理汇总了PHP中graph::set_x_label_style方法的典型用法代码示例。如果您正苦于以下问题:PHP graph::set_x_label_style方法的具体用法?PHP graph::set_x_label_style怎么用?PHP graph::set_x_label_style使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graph
的用法示例。
在下文中一共展示了graph::set_x_label_style方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: grafico
function grafico($anio = '')
{
$this->load->library('Graph');
if (empty($anio)) {
return;
}
$fechai = $anio . '0101';
$fechaf = $anio . '1231';
$mSQL = "SELECT a.vd, LEFT(b.nombre, 8)as nombre2, \n\t\t sum(a.totalg*IF(a.tipo_doc='D', -1, 1)) AS grantotal, \n\t\t sum(a.totalg*(a.referen IN ('E', 'M'))*IF(a.tipo_doc='D', -1, 1)) AS contado, \n\t\t sum(a.totalg*(a.referen NOT IN ('E', 'M'))*IF(a.tipo_doc='D', -1, 1)) AS credito \n\t\t FROM sfac AS a \n\t\t JOIN vend AS b ON a.vd=b.vendedor \n\t\t WHERE a.tipo_doc<>'X' AND a.fecha>='{$fechai}' AND a.fecha<='{$fechaf}' \n\t\t GROUP BY a.vd ORDER BY a.vd,grantotal DESC LIMIT 10";
$maxval = 0;
$query = $this->db->query($mSQL);
$data_1 = $data_2 = $data_3 = $vendedor = array();
foreach ($query->result() as $row) {
if ($row->grantotal > $maxval) {
$maxval = $row->grantotal;
}
$nombre[] = $row->nombre2;
$vendedor[] = $row->vd;
$data_1[] = $row->contado;
$data_2[] = $row->credito;
$data_3[] = $row->grantotal;
}
$om = 1;
while ($maxval / $om > 100) {
$om = $om * 10;
}
$bar_1 = new bar(75, '#0053A4');
$bar_2 = new bar(75, '#9933CC');
$bar_3 = new bar(75, '#639F45');
$bar_1->key('Contado', 10);
$bar_2->key('Credito', 10);
$bar_3->key('Total', 10);
for ($i = 0; $i < count($data_1); $i++) {
$bar_1->add_data_tip($data_1[$i] / $om, graph::esc(number_format($data_1[$i], 2, ',', '.')));
$bar_2->add_data_tip($data_2[$i] / $om, graph::esc(number_format($data_2[$i], 2, ',', '.')));
$bar_3->add_data_tip($data_3[$i] / $om, graph::esc(number_format($data_3[$i], 2, ',', '.')));
$bar_1->links[] = site_url("/ventas/vendedoresmensuales/index/{$anio}/" . $vendedor[$i]);
$bar_2->links[] = site_url("/ventas/vendedoresmensuales/index/{$anio}/" . $vendedor[$i]);
$bar_3->links[] = site_url("/ventas/vendedoresmensuales/index/{$anio}/" . $vendedor[$i]);
}
$g = new graph();
$g->title('Los 10 vendedores con los indice de ventas más altos en el año' . $anio, '{font-size: 22px; color:##00264A}');
$g->set_is_decimal_separator_comma(1);
$g->data_sets[] = $bar_1;
$g->data_sets[] = $bar_2;
$g->data_sets[] = $bar_3;
$g->set_x_labels($nombre);
$g->set_x_label_style(10, '#000000', 3, 1);
$g->set_x_axis_steps(10);
$g->set_x_legend('Vendedores', 14, '#004381');
$g->bg_colour = '#FFFFFF';
$g->set_tool_tip('#key#<br>Vendedor: #x_label# <br>Monto: #tip#');
$g->set_y_max(ceil($maxval / $om));
$g->y_label_steps(5);
$g->set_y_legend('Ventas x ' . number_format($om, 0, '', '.') . ' (Bs)', 16, '#004381');
echo utf8_encode($g->render());
}
示例2: grafico
function grafico($titulo)
{
$this->load->library('Graph');
$mSQL_1 = "SELECT cod_cli,nombre, \r\n\t\t\tsum(totalg*IF(tipo_doc='D', -1, 1)) AS grantotal, \r\n\t\t\tsum(totalg*(referen IN ('E', 'M'))*IF(tipo_doc='D', -1, 1)) AS contado,\r\n\t\t\tsum(totalg*(referen NOT IN ('E', 'M'))*IF(tipo_doc='D', -1, 1)) AS credito \r\n\t\t\tFROM sfac\r\n\t\t\tWHERE tipo_doc<>'X' AND fecha>='20070101' AND fecha<='20071231' \r\n\t\t\tGROUP BY cod_cli ORDER BY grantotal DESC LIMIT 10";
// generate some random data
srand((double) microtime() * 1000000);
$bar_1 = new bar_fade(50, '#209B2C');
$bar_1->key('Contado', 10);
$bar_2 = new bar_fade(50, '#9933CC');
$bar_2->key('Credito', 10);
$bar_3 = new bar_fade(50, '#639F45');
$bar_3->key('Total', 10);
$maxval = 0;
$label = $tips = array();
$query = $this->db->query($mSQL_1);
foreach ($query->result() as $row) {
if ($row->grantotal > $maxval) {
$maxval = $row->grantotal;
}
$bar_1->data[] = $row->contado;
$bar_2->data[] = $row->credito;
$bar_3->data[] = $row->grantotal;
//$bar_1->tips = $data_tips_3;
$tips[] = $row->nombre;
$label[] = $row->cod_cli;
}
$g = new graph();
$g->title($titulo, '{font-size: 26px;}');
$g->data_sets[] = $bar_1;
$g->data_sets[] = $bar_2;
$g->data_sets[] = $bar_3;
$g->set_x_labels($label);
$g->set_x_label_style(10, '#9933CC', 2, 1);
$g->set_x_axis_steps(10);
$g->bg_colour = '#FFFFFF';
$g->set_tool_tip('#key#<br>Codigo de Clinte: #x_label# <br>Monto: #tip#');
$g->tips = $tips;
$g->set_y_max($maxval);
$g->y_label_steps(3);
$g->set_y_legend('Open Flash Chart', 12, '0x736AFF');
echo utf8_encode($g->render());
}
示例3: gdiarias
function gdiarias($anio = '', $cliente = '', $mes = '')
{
$this->load->library('Graph');
if (empty($mes) or empty($anio) or empty($cliente)) {
return;
}
$fechai = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '01';
$fechaf = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '31';
$mSQL = "SELECT cod_cli,nombre,fecha,DAYOFMONTH(fecha) as dia, \n\t\tsum(gtotal*IF(tipo='D', -1, 1)) AS grantotal, \n\t\tsum(gtotal*IF(tipo='D', -1, 1)) AS contado, \n\t\tsum(gtotal*IF(tipo='D', -1, 1)) AS credito \n\t\tFROM fmay \n\t\tWHERE tipo<>'X' AND fecha>='{$fechai}' AND fecha<='{$fechaf}' AND cod_cli='{$cliente}' \n\t\tGROUP BY fecha ORDER BY fecha,grantotal DESC LIMIT 31";
//echo $mSQL;
$maxval = 0;
$query = $this->db->query($mSQL);
foreach ($query->result() as $row) {
if ($row->grantotal > $maxval) {
$maxval = $row->grantotal;
}
$fecha[] = $row->dia;
$data_1[] = $row->contado;
$data_2[] = $row->credito;
$data_3[] = $row->grantotal;
}
$nombre = $row->nombre;
$om = 1;
while ($maxval / $om > 100) {
$om = $om * 10;
}
$bar_1 = new bar(75, '#0053A4');
$bar_2 = new bar(75, '#9933CC');
$bar_3 = new bar(75, '#639F45');
$bar_1->key('Contado', 10);
$bar_2->key('Credito', 10);
$bar_3->key('Total', 10);
for ($i = 0; $i < count($data_1); $i++) {
$bar_1->add_data_tip($data_1[$i] / $om, graph::esc(number_format($data_1[$i], 2, ',', '.')));
$bar_2->add_data_tip($data_2[$i] / $om, graph::esc(number_format($data_2[$i], 2, ',', '.')));
$bar_3->add_data_tip($data_3[$i] / $om, graph::esc(number_format($data_3[$i], 2, ',', '.')));
}
$g = new graph();
$g->set_is_decimal_separator_comma(1);
if ($maxval > 0) {
$g->title('Compras de el cliente ' . $nombre . ' en el mes ' . $mes . '/' . $anio, '{font-size: 16px; color:#0F3054}');
$g->data_sets[] = $bar_1;
$g->data_sets[] = $bar_2;
$g->data_sets[] = $bar_3;
$g->set_x_labels($fecha);
$g->set_x_label_style(10, '#000000', 3, 1);
$g->set_x_axis_steps(10);
$g->set_x_legend('Dias', 14, '#004381');
$g->bg_colour = '#FFFFFF';
$g->set_tool_tip('#key#<br>Dia: #x_label# <br>Monto: #tip#');
$g->set_y_max(ceil($maxval / $om));
$g->y_label_steps(5);
$g->set_y_legend('hospitalidad x ' . number_format($om, 0, '', '.') . ' (Bs)', 16, '#004381');
} else {
$g->title('No existen ventas con los datos seleccionados', '{font-size:18px; color: #d01f3c}');
}
$g->bg_colour = '#FFFFFF';
echo utf8_encode($g->render());
}
示例4: date
$data_2[] = $row['vr_custo'];
$data_3[] = $row['vr_totalvenda']-$row['vr_custo'];
$labels[] = date('d/m/Y',strtotime($row['data_venda']));
$max_value = ($max_value<$row['vr_totalvenda'])?$row['vr_totalvenda']:$max_value;
}
$g = new graph();
$g->set_data( $data_1 );
$g->set_data( $data_2 );
$g->set_data( $data_3 );
$g->line_hollow( 3, 5, '0x9933CC', 'Venda', 10 );
$g->line_hollow( 3, 5, '0xCC3399', 'Custo', 10); // <-- 3px thick + dots
$g->line_hollow( 3, 5, '0x80a033', 'Lucro', 10 );
$g->set_x_labels( $labels );
$g->set_x_label_style( 10, '0x000000', 0, 2 );
$g->set_y_max( $max_value );
$g->y_label_steps( 4 );
$g->set_y_legend( 'Valores em Real - R$', 12, '#000000' );
$g->bg_colour = '#FFFFFF';
echo $g->render();
?>
示例5: grafico
function grafico($codigo = '', $mes = '', $anio = '')
{
$this->load->library('Graph');
if (empty($mes) and empty($anio)) {
return;
}
$fechad = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '01';
$fechah = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '31';
$mSQL = "SELECT DATE_FORMAT(fecha, '%d')as fecha, codigo, sum(cantidad) cantidad, IF(sum(cantidad)<=salcant,sum(cantidad),salcant)*(salcant>0)as salcant \n\t\tFROM costos \n\t\tWHERE codigo='{$codigo}' AND fecha>='{$fechad}' AND fecha<='{$fechah}' AND origen='3I'\n\t\tGROUP BY fecha HAVING cantidad>0";
echo $mSQL;
$maxval = 0;
$query = $this->db->query($mSQL);
foreach ($query->result() as $row) {
if ($row->cantidad > $maxval) {
$maxval = $row->cantidad;
}
$fecha[] = $row->fecha;
$codigo = $row->codigo;
$data_1[] = $row->cantidad;
$data_2[] = $row->salcant;
}
$fechadd = dbdate_to_human($fechad);
$fechahh = dbdate_to_human($fechah);
$nombre = $this->datasis->dameval("SELECT descrip FROM sinv WHERE codigo='{$codigo}'");
$om = 1;
while ($maxval / $om > 100) {
$om = $om * 10;
}
$bar_1 = new bar_glass(55, '#D54C78', '#C31812');
$bar_1->key('Ventas', 10);
$bar_2 = new line_dot(3, 5, '#0066CC', 'Downloads', 10);
$bar_2->key('Existencias', 10);
for ($i = 0; $i < count($data_1); $i++) {
$bar_1->add_data_tip($data_1[$i] / $om, graph::esc(number_format($data_1[$i], 2, ',', '.')));
$bar_2->add_data_tip($data_2[$i] / $om, graph::esc(number_format($data_2[$i], 2, ',', '.')));
// $bar_1->links[]= site_url("/inventario/gproductos/mensuales/$anio/".str_replace('/',':slach:',$proveed[$i]));
// $bar_1->links[]= site_url("/inventario/gproductos/mensuales/$anio/".raencode($proveed[$i]));
}
$g = new graph();
$g->set_is_decimal_separator_comma(1);
if ($maxval > 0) {
$g->title('Grafico de ' . $nombre . ' Desde ' . $fechadd . ' Hasta ' . $fechahh, '{font-size: 16px; color:#0F3054}');
$g->data_sets[] = $bar_1;
$g->data_sets[] = $bar_2;
$g->set_x_labels($fecha);
$g->set_x_label_style(10, '#000000', 2, 1);
$g->set_x_axis_steps(10);
$g->set_x_legend('Fecha', 14, '#004381');
$g->bg_colour = '#FFFFFF';
$g->set_tool_tip('#key#<br>Fecha: #x_label# <br>Cantidad: #tip#');
$g->set_y_max(ceil($maxval / $om));
$g->y_label_steps(5);
//$g->set_y_legend('Ventas x '.number_format($om,0,'','.').' (Bs)', 16, '#004381' );
} else {
$g->title('No existen datos con la informacion seleccionada', '{font-size:18px; color: #d01f3c}');
}
$g->bg_colour = '#FFFFFF';
echo utf8_encode($g->render());
}
示例6: return_ofc_data
function return_ofc_data($styles)
{
global $cms, $ps;
$ofc = $cms->input['ofc'];
$data = array();
$data_avg = array();
$avg = 0;
$interval = 1000;
$maxlimit = 1000;
$minlimit = 0;
$max = 21;
$field = $ofc == 'skill' ? 'dayskill' : $ofc;
if (!in_array($field, array('skill', 'kills', 'onlinetime'))) {
$field = 'dayskill';
}
$plrid = $cms->input['id'];
$ps->db->query("SELECT statdate,{$field} FROM {$ps->t_plr_data} WHERE plrid=" . $ps->db->escape($plrid, true) . " ORDER BY statdate DESC LIMIT {$max}");
$i = 1;
while (list($statdate, $skill) = $ps->db->fetch_row(0)) {
$skill = round($skill);
$sum += $skill;
$data[] = $skill;
$labels[] = $statdate;
}
if ($data) {
$data = array_reverse($data);
$labels = array_reverse($labels);
$avg = $sum / count($data);
$data_avg[] = $avg;
$data_avg = array_pad($data_avg, count($data) - 1, 'null');
// yes, 'null' is a string
$data_avg[] = $avg;
$minlimit = floor(min($data) / $interval) * $interval;
$maxlimit = ceil(max($data) / $interval) * $interval;
}
include_once PS_ROOTDIR . '/includes/ofc/open-flash-chart.php';
$g = new graph();
$g->bg_colour = $styles->val('flash.plrskill.bgcolor', 'flash.bgcolor');
$g->title($styles->val('flash.plrskill.title'), '{' . $styles->val('flash.plrskill.title.style', 'font-size: 12px', true) . '}');
$g->set_data($data_avg);
$g->set_data($data);
$lines = $styles->attr('flash.plrskill.lines.line');
$g->line(coalesce($lines[0]['width'], 1), coalesce($lines[0]['color'], '#9999ee'), coalesce($lines[0]['key'], $cms->trans('Average')), coalesce($lines[0]['key_size'], $styles->val('flash.plrskill.lines.key_size'), 9));
$g->line(coalesce($lines[1]['width'], 1), coalesce($lines[1]['color'], '#9999ee'), coalesce($lines[1]['key'], $cms->trans('Skill')), coalesce($lines[1]['key_size'], $styles->val('flash.plrskill.lines.key_size'), 9));
// label each point with its value
$g->set_x_labels($labels);
// $g->set_x_axis_steps(count($labels) / 3 + 1);
// $g->set_x_tick_size(1);
// $g->set_x_label_style( 10, '0x000000', 0, 2 );
// $g->set_x_label_style('none');
$g->set_x_label_style(8, '#000000', 2);
$g->set_inner_background(coalesce($styles->val('flash.plrskill.bg_inner1', 'flash.bg_inner1'), '#E3F0FD'), coalesce($styles->val('flash.plrskill.bg_inner2', 'flash.bg_inner2'), '#CBD7E6'), coalesce($styles->val('flash.plrskill.bg_inner_angle', 'flash.bg_inner_angle'), 90));
$g->x_axis_colour('#eeeeee', '#eeeeee');
$g->y_axis_colour('#eeeeee', '#eeeeee');
// $g->set_x_offset( false );
// set the Y max
$g->set_y_max($maxlimit);
$g->set_y_min($minlimit);
// label every 20 (0,20,40,60)
// $g->x_label_steps( 2 );
// display the data
print $g->render();
}
示例7: gproducto
function gproducto($anio = '', $depto = '', $fami = '', $grupo = '')
{
$this->load->library('Graph');
if (empty($anio)) {
return;
}
$fechai = $anio . '0101';
$fechaf = $anio . '1231';
$mSQL = "SELECT a.codigo,a.depto,a.familia,a.grupo,e.descrip as nombre,\n\t\tSUM(a.monto) AS grantotal, \n\t\tSUM(a.costo) AS costo, \n\t\tSUM(a.cantidad) AS cantidad,\n\t\tSUM(a.monto)-SUM(a.costo) AS ganancia\n\t\tFROM est_item AS a\n\t\tJOIN maes AS e ON a.codigo= e.codigo\n\t\tWHERE a.fecha>='{$fechai}' AND a.fecha<='{$fechaf}' AND a.depto='{$depto}' AND a.familia='{$fami}' AND a.grupo='{$grupo}'\n\t\tGROUP BY a.codigo LIMIT 10";
//echo $mSQL;
$maxval = 0;
$query = $this->db->query($mSQL);
foreach ($query->result() as $row) {
if ($row->grantotal > $maxval) {
$maxval = $row->grantotal;
}
$nombre[] = $row->nombre;
$famili = $row->famili;
$dpto = $row->dpto;
$grup = $row->grup;
$data_1[] = $row->grantotal;
$data_2[] = $row->ganancia;
}
$om = 1;
while ($maxval / $om > 100) {
$om = $om * 10;
}
$bar_1 = new bar_fade(55, '#C31812');
$bar_2 = new bar_fade(55, '#424581');
$bar_1->key('Total', 10);
$bar_2->key('Ganancias', 10);
for ($i = 0; $i < count($data_1); $i++) {
$bar_1->add_data_tip($data_1[$i] / $om, graph::esc(number_format($data_1[$i], 2, ',', '.')));
$bar_2->add_data_tip($data_2[$i] / $om, graph::esc(number_format($data_2[$i], 2, ',', '.')));
}
$g = new graph();
$g->set_is_decimal_separator_comma(1);
if ($maxval > 0) {
$g->title('Ventas de el año ' . $anio, '{font-size: 16px; color:#0F3054}');
$g->data_sets[] = $bar_1;
$g->data_sets[] = $bar_2;
$g->set_x_labels($nombre);
$g->set_x_label_style(10, '#000000', 2, 1);
$g->set_x_axis_steps(10);
$g->set_x_legend('Productos', 14, '#004381');
$g->bg_colour = '#FFFFFF';
$g->set_tool_tip('#key#<br>Producto: #x_label# <br>Monto: #tip#');
$g->set_y_max(ceil($maxval / $om));
$g->y_label_steps(5);
$g->set_y_legend('Ventas x ' . number_format($om, 0, '', '.') . ' (Bs)', 16, '#004381');
} else {
$g->title('No existen ventas en el año seleccionado', '{font-size:18px; color: #d01f3c}');
}
$g->bg_colour = '#FFFFFF';
echo utf8_encode($g->render());
}
示例8: array
$res_max = mysql_query($sql_max);
$num_max = mysql_num_rows($res_max);
$fet_max = mysql_fetch_array($res_max);
//$max_y=($num_data * 5);
$max_y = $fet_max['tkts'] + 50;
//$bar = new bar_outline( 50, '#3399cc', '#3399ff' );
$bar = new bar_outline($max_y, '#3399cc', '#3399ff');
$bar->key('Tickets', 10);
$data = array();
$lbl = array();
if ($num_data > 0) {
do {
$bar->data[] = intval($fet_data['tkts']);
$xlabels[] = mysql_escape_string($fet_data['tktcategoryname']);
} while ($fet_data = mysql_fetch_array($res_data));
$g = new graph();
$g->data_sets[] = $bar;
$g->bg_colour = '#ffffff';
$g->set_x_labels($xlabels);
$g->set_x_label_style(10, '#9933CC', 2, 1);
//
// and tick every second value:
//
$g->set_x_axis_steps(1);
//
$g->set_y_max($max_y);
$g->y_label_steps(4);
$g->set_y_legend('No. of Tickets', 12, '#736AFF');
echo $g->render();
}
//close if thre is data
示例9: gdiarias
function gdiarias($anio = '', $producto = '', $mes = '')
{
$this->load->library('Graph');
$this->lang->load('calendar');
if (empty($anio)) {
return;
}
$producto = radecode($producto);
$fechai = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '01';
$fechaf = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '31';
//echo "fechai=".$fechai;
//echo "fechaf=".$fechaf;
$mSQL = "SELECT codigo, LEFT(descrip,20)AS nombre,DAYOFMONTH(a.fecha) as dia,\n SUM(cantidad)AS cantidad,\n SUM(importe)AS grantotal\n FROM itscst AS a\n WHERE fecha>='{$fechai}' AND fecha<='{$fechaf}' AND codigo='{$producto}'\n GROUP BY dia ORDER BY fecha";
//echo $mSQL;
$maxval = 0;
$query = $this->db->query($mSQL);
foreach ($query->result() as $row) {
if ($row->grantotal > $maxval) {
$maxval = $row->grantotal;
}
$fecha[] = $row->dia;
$nombre = $row->nombre;
$data_1[] = $row->grantotal;
}
$om = 1;
while ($maxval / $om > 100) {
$om = $om * 10;
}
$bar_1 = new bar(75, '#ADD8E6');
$bar_1->key('Compras', 10);
for ($i = 0; $i < count($data_1); $i++) {
$bar_1->add_data_tip($data_1[$i] / $om, graph::esc(number_format($data_1[$i], 2, ',', '.')));
}
$g = new graph();
$g->set_is_decimal_separator_comma(1);
if ($maxval > 0) {
$g->title('Compra de ' . $nombre . ' en el mes ' . $mes . '/' . $anio, '{font-size: 16px; color:##00264A}');
$g->data_sets[] = $bar_1;
$g->set_x_labels($fecha);
$g->set_x_label_style(9, '#000000', 3, 1);
$g->set_x_axis_steps(10);
$g->x_axis_colour('#A6A6A6', '#ADB5C7');
$g->set_x_legend('Dias', 16, '#004381');
$g->bg_colour = '#FFFFFF';
$g->set_tool_tip('#key#<br>Dia: #x_label# <br>Monto: #tip#');
$g->set_y_max(ceil($maxval / $om));
$g->y_label_steps(5);
$g->y_axis_colour('#A6A6A6', '#ADB5C7');
$g->set_y_legend('Compras x ' . number_format($om, 0, '', '.') . ' (Bs)', 16, '#004381');
} else {
$g->title('No existen compras con los datos seleccionados', '{font-size:18px; color: #d01f3c}');
}
$g->bg_colour = '#FFFFFF';
echo utf8_encode($g->render());
}
示例10: graph
} else {
$bar->data = array_slice($bar->data, 0, 50);
$x_labels = array_slice($x_labels, 0, 50);
}
$g = new graph();
if ($flaghigher == 40000) {
$g->set_bg_image('/img/guld_silver_bg500.gif', 'right', 'bottom');
$g->set_y_max(40000);
$g->y_label_steps(4);
} else {
$g->set_bg_image('/img/20000_guld_silver_bg500.gif', 'right', 'bottom');
$g->set_y_max(20000);
$g->y_label_steps(2);
}
$g->set_x_labels($x_labels);
$g->set_x_label_style(8, "#00000", 2, 3);
$g->set_x_axis_steps(0);
//
// BAR CHART:
//
//$g->set_data( $data );
//$g->bar_filled( 50, '#9933CC', '#8010A0', 'Page views', 10 );
//
// ------------------------
//
$g->title(' ', '{font-size: 1px;}');
$g->data_sets[] = $bar;
echo $g->render();
?>
?>
示例11: gmensuales
function gmensuales($anio = '', $dia = '')
{
$this->load->library('Graph');
//$this->lang->load('calendar');
//if (empty($mes) or empty($dia)) return;
$fechai = $anio . '0101';
$fechaf = $anio . '1231';
$mSQL = "SELECT fecha,IF(WEEKDAY(fecha)=0,'Lunes',IF(WEEKDAY(fecha)=1,'Martes',IF(WEEKDAY(fecha)=2,'Miercoles',IF(WEEKDAY(fecha)=3,'Jueves',IF(WEEKDAY(fecha)=4,'Viernes',IF(WEEKDAY(fecha)=5,'Sabado','Domingo'))))))AS tdia,\n DATE_FORMAT(fecha,'%m')AS mes,SUM(monto)AS grantotal,SUM(impuesto)AS IVA,SUM(transac)as transacciones \n\t\tFROM est_fecha WHERE fecha>='{$fechai}' AND fecha<='{$fechaf}'AND WEEKDAY(fecha)='{$dia}'\n\t\tGROUP BY MONTH(fecha)\n\t\tORDER BY fecha ASC";
//echo $mSQL;
$maxval = 0;
$query = $this->db->query($mSQL);
foreach ($query->result() as $row) {
if ($row->grantotal > $maxval) {
$maxval = $row->grantotal;
}
$mes[] = $row->mes;
$tdia = $row->tdia;
$data_1[] = $row->grantotal;
}
$om = 1;
while ($maxval / $om > 100) {
$om = $om * 10;
}
$bar_1 = new bar_outline(50, '#56AC8B', '#3F7E66');
$bar_1->key('Monto', 10);
for ($i = 0; $i < count($data_1); $i++) {
$bar_1->add_data_tip($data_1[$i] / $om, graph::esc(number_format($data_1[$i], 2, ',', '.')));
}
$g = new graph();
$g->set_is_decimal_separator_comma(1);
if ($maxval > 0) {
$g->title('Ventas en el año ' . $anio . ' del dia ' . $tdia, '{font-size: 16px; color:##00264A}');
$g->data_sets[] = $bar_1;
$g->x_axis_colour('#A6A6A6', '#ADB5C7');
$g->set_x_labels($mes);
$g->set_x_label_style(10, '#000000', 3, 1);
$g->set_x_axis_steps(10);
$g->set_x_legend('Mes', 14, '#004381');
$g->bg_colour = '#FFFFFF';
$g->set_tool_tip('#key#<br>Mes: #x_label# <br>Monto: #tip#');
$g->set_y_max(ceil($maxval / $om));
$g->y_label_steps(5);
$g->y_axis_colour('#A6A6A6', '#ADB5C7');
$g->set_y_legend('Ventas x ' . number_format($om, 0, '', '.') . ' (Bs)', 16, '#004381');
} else {
$g->title('No existen ventas con los datos seleccionados', '{font-size:18px; color: #d01f3c}');
}
$g->bg_colour = '#FFFFFF';
echo utf8_encode($g->render());
}
示例12: graph
$g = new graph();
$g->title( $title, '{font-size: 18px; color: #A0A0A0;}' );
$g->set_inner_background( '#E3F0FD', '#CBD7E6', 90 );
$g->bg_colour = '#FFFFFF';
if ($sort == true){
array_multisort($labels,$data);
}
if ($type == 'line'){
$g->set_data($data);
$g->line_hollow( 2, 4, '#5E83BF', 'Documentos', 10 );
$g->set_x_labels($labels);
$g->set_x_label_style( 10, '0x000000', 0, 2 );
$g->set_y_max( max($data) );
$g->y_label_steps(4);
}else if ($type == 'pie'){
$g->pie(60,'#505050','{font-size: 11px; color: #404040}');
$g->pie_values( $data, $labels );
$g->pie_slice_colours( array('#d01f3c','#356aa0','#C79810','#FFCC99','#009933','#FF99FF','#33FFFF','#CCCC99','#330033','#00CCFF','#CCCCCC','#FFCC00','#FF0033','#660000','#FFCCCC','#33FF33','#FF6633' ) );
}else{
$bar = new bar( 95, '#5E83BF', '#424581' );
//$bar->key( 'documentos', 10 );
示例13: gmensuales
function gmensuales($mes = '', $anio = '')
{
$this->load->library('Graph');
$this->lang->load('calendar');
if (empty($anio) or empty($mes)) {
return;
}
$fechai = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '01';
$fechaf = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '31';
$mSQL = "SELECT DAYOFMONTH(fecha)AS dia,\r\n SUM(monto)AS grantotal\r\n FROM pres \r\n WHERE fecha>='{$fechai}' AND fecha<='{$fechaf}'\r\n GROUP BY fecha";
//echo $mSQL;
$maxval = 0;
$query = $this->db->query($mSQL);
foreach ($query->result() as $row) {
if ($row->grantotal > $maxval) {
$maxval = $row->grantotal;
}
$fecha[] = $row->dia;
$data_1[] = $row->grantotal;
}
$om = 1;
while ($maxval / $om > 100) {
$om = $om * 10;
}
$bar_1 = new bar(75, '#329B98');
$bar_1->key('Total', 10);
for ($i = 0; $i < count($data_1); $i++) {
$bar_1->add_data_tip($data_1[$i] / $om, graph::esc(number_format($data_1[$i], 2, ',', '.')));
}
$g = new graph();
$g->set_is_decimal_separator_comma(1);
if ($maxval > 0) {
$g->title('Prestamos de el mes ' . $mes . '/' . $anio, '{font-size: 16px; color:#0F3054}');
$g->data_sets[] = $bar_1;
$g->set_x_labels($fecha);
$g->set_x_label_style(10, '#000000', 3, 1);
$g->set_x_axis_steps(10);
$g->set_x_legend('Dias', 16, '#004381');
$g->bg_colour = '#FFFFFF';
$g->set_tool_tip('#key#<br>Dia: #x_label# <br>Monto: #tip#');
$g->set_y_max(ceil($maxval / $om));
$g->y_label_steps(5);
$g->set_y_legend('Prestamos x ' . number_format($om, 0, '', '.') . ' (Bs)', 16, '#004381');
} else {
$g->title('No existen prestamos con los datos seleccionados', '{font-size:18px; color: #d01f3c}');
}
$g->bg_colour = '#FFFFFF';
echo utf8_encode($g->render());
}
示例14: gmensuales
function gmensuales($anio = '', $cliente = '')
{
$this->load->library('Graph');
if (empty($anio) or empty($cliente)) {
return;
}
$fechai = $anio . '0101';
$fechaf = $anio . '1231';
$mSQL = "SELECT cliente,nombres,DATE_FORMAT(fecha,'%m')AS mes, SUM(gtotal)AS grantotal, SUM(impuesto)AS impuesto \n\t\tFROM viefac \n\t\tWHERE tipo<>'X' AND fecha>='{$fechai}' AND fecha<='{$fechaf}' AND cliente='{$cliente}' \n\t\tGROUP BY MONTH(fecha) ORDER BY fecha";
//echo $mSQL;
$maxval = 0;
$query = $this->db->query($mSQL);
foreach ($query->result() as $row) {
if ($row->grantotal > $maxval) {
$maxval = $row->grantotal;
}
$nombre = $row->nombres;
$mes[] = $row->mes;
$data_1[] = $row->grantotal;
}
$om = 1;
while ($maxval / $om > 100) {
$om = $om * 10;
}
$bar_1 = new bar(75, '#8E4B97');
$bar_1->key('Total', 10);
for ($i = 0; $i < count($data_1); $i++) {
$bar_1->add_data_tip($data_1[$i] / $om, graph::esc(number_format($data_1[$i], 2, ',', '.')));
//$bar_1->links[]= site_url("supermercado/clientes/diarias/$anio/$cliente/$mes[$i]");
}
$g = new graph();
$g->set_is_decimal_separator_comma(1);
if ($maxval > 0) {
$g->title('Compras de el cliente ' . $nombre . ' en el año ' . $anio, '{font-size: 16px; color:#0F3054}');
$g->data_sets[] = $bar_1;
$g->set_x_labels($mes);
$g->set_x_label_style(10, '#000000', 3, 1);
$g->set_x_axis_steps(10);
$g->set_x_legend('Meses', 14, '#004381');
$g->bg_colour = '#FFFFFF';
$g->set_tool_tip('#key#<br>Mes: #x_label# <br>Monto: #tip#');
$g->set_y_max(ceil($maxval / $om));
$g->y_label_steps(5);
$g->set_y_legend('supermercado x ' . number_format($om, 0, '', '.') . ' (Bs)', 16, '#004381');
} else {
$g->title('No existen ventas con los datos seleccionados', '{font-size:18px; color: #d01f3c}');
}
$g->bg_colour = '#FFFFFF';
echo utf8_encode($g->render());
}
示例15: gmensuales
function gmensuales($anio = '', $mes = '')
{
$this->load->library('Graph');
if (empty($mes) or empty($anio)) {
return;
}
$fechai = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '01';
$fechaf = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '31';
$mSQL = "SELECT DAYOFMONTH(fecha)as dia, fecha,\n\t\tSUM(monto)AS grantotal,SUM(impuesto)AS IVA,SUM(transac)as transacciones \n\t\tfrom est_fecha where fecha>='{$fechai}' AND fecha<='{$fechaf}'\n\t\tGROUP BY fecha \n\t\tORDER BY fecha ASC";
//echo $mSQL;
$maxval = 0;
$query = $this->db->query($mSQL);
foreach ($query->result() as $row) {
if ($row->grantotal > $maxval) {
$maxval = $row->grantotal;
}
$fecha[] = $row->dia;
$data_1[] = $row->grantotal;
}
$om = 1;
while ($maxval / $om > 100) {
$om = $om * 10;
}
$bar_1 = new bar(75, '#44AC37');
$bar_1->key('Monto', 10);
for ($i = 0; $i < count($data_1); $i++) {
$bar_1->add_data_tip($data_1[$i] / $om, graph::esc(number_format($data_1[$i], 2, ',', '.')));
}
$g = new graph();
$g->set_is_decimal_separator_comma(1);
if ($maxval > 0) {
$g->title('Ventas de en el mes ' . $mes . '/' . $anio, '{font-size: 16px; color:##00264A}');
$g->data_sets[] = $bar_1;
$g->x_axis_colour('#A6A6A6', '#ADB5C7');
$g->set_x_labels($fecha);
$g->set_x_label_style(10, '#000000', 3, 1);
$g->set_x_axis_steps(10);
$g->set_x_legend('Dias', 14, '#004381');
$g->bg_colour = '#FFFFFF';
$g->set_tool_tip('#key#<br>Dia: #x_label# <br>Monto: #tip#');
$g->set_y_max(ceil($maxval / $om));
$g->y_label_steps(5);
$g->y_axis_colour('#A6A6A6', '#ADB5C7');
$g->set_y_legend('Ventas x ' . number_format($om, 0, '', '.') . ' (Bs)', 16, '#004381');
} else {
$g->title('No existen ventas con los datos seleccionados', '{font-size:18px; color: #d01f3c}');
}
$g->bg_colour = '#FFFFFF';
echo utf8_encode($g->render());
}