Programación php
Email: Password:


¡Regístrate gratis! | ¿Has perdido tu password?

Home
Blog

En él que podrás informarte de todas las noticias relacionadas con el posicionamiento de páginas web.

Ir al Blog de posicionamiento web



Foro de programación en PHP

Responder el mensaje

Creacionde graficas

Autor: dcreate
Publicado: 01-10-2009 03:11 PM
Hola amigos, estoy empezando a usar la libreria jpgraph y quisiera saber como se crean las graficas de barras, es que aprendi a hacer graficas pero son de pastel, espero me puedan ayudar. Muchas gracias por su atencion
Autor: Mamado_12@hotmail.com
Publicado: 07-10-2009 12:19 PM
Buscale men y me habizas
Autor: dcreate
Publicado: 13-10-2009 03:31 PM
ya resolvi el programa de graficas y si a alguien le sirve aki les dejo un poco.

<?php
//insertar los resultados en arrays de la busqueda 1

//insertar en arrays los resultados de la busqueda 2
// $Id: groupbarex1.php,v 1.2 2002/07/11 23:27:28 aditus Exp $
require_once ("jpgraph/jpgraph.php");
require_once ("jpgraph/jpgraph_bar.php");

$datay1=array(1,2,3,5,4,9,10,3,5,3,7,8,);

$datay2=array(8,2,5,4,3,5,0,6,9,3,7,1,);


$datay4=array("ENE","FEB","MAR","ABR","MAY","JUN","JUL","AGO","SEP","OCT","NOV","DIC");
$graph = new Graph(980,460,'auto');
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(80,30,40,40);


$graph->xaxis->SetTickLabels($datay4);
$graph->xaxis->title->Set('CONSUMO EN KWH');
$graph->yaxis->title->Set('');
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);

$graph->title->Set('INSTALACION: ');
$graph->title->SetFont(FF_FONT1,FS_BOLD);

$bplot1 = new BarPlot($datay1);
$bplot2 = new BarPlot($datay2);
$bplot1->SetFillColor("#CCCCCC");
$bplot2->SetFillColor("#0033FF");
$bplot1->SetLegend('AÑO: '.$an_pas);
$bplot2->SetLegend('AÑO: '.$an);



$bplot1->SetShadow();
$bplot2->SetShadow();


$bplot1->SetShadow();
$bplot2->SetShadow();


$gbarplot = new GroupBarPlot(array($bplot1,$bplot2));
$gbarplot->SetWidth(0.6);
$graph->Add($gbarplot);

$graph->Stroke();
?>

la clase es la jpgraph

espero y les sirva