Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/04/2010, 02:02
Avatar de richicasas
richicasas
 
Fecha de Ingreso: abril-2007
Ubicación: Colombia
Mensajes: 692
Antigüedad: 17 años, 1 mes
Puntos: 13
Exclamación Generar un png en vez de un php con JPGRAPH

Hola a todos, resulta que estoy trabajando con la libreria de graficos JPGRAPH, tengo el siguiente ejemplo:
Código PHP:
$graph = new Graph(550,540);
$graph->img->SetMargin(80,80,35,205);
$graph->SetScale("textlin");
$graph->SetMarginColor("lightblue:1.1");
$graph->SetShadow();

// Set up the title for the graph
$graph->title->Set($nombre);
$graph->title->SetMargin(15);
$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
$graph->title->SetColor("darkred");

// Setup font for axis
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10);

// Show 0 label on Y-axis (default is not to show)
$graph->yscale->ticks->SupressZeroLabel(false);

// Setup X-axis labels
$graph->xaxis->SetTickLabels($dataq);
$graph->xaxis->SetLabelAngle(50);

// Create the bar pot
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);

// Setup color for gradient fill style
$bplot->SetFillGradient("navy:0.9","navy:1.85",GRAD_LEFT_REFLECTION);

// Set color for the frame of each bar
$bplot->SetColor("white");
$graph->Add($bplot);

// Finally send the graph to the browser
$graph->Stroke(); 
Y para mostrar el grafico hago lo siguiente:
Código PHP:
<img src="grafico.php"
Todo funciona bien, pero si examino el codigo fuente o al grafico le doy click derecho y ver imagen me aparece la ruta "grafico.php" como la imagen y lo que quiero es que me aparezca por ejemplo: grafico.png o algun formato de imagen.

Además, alguien sabe como puedo exportar a excel dicha grafica ??, lo intente colocando la ruta completa pero nada el excel me aparece vacio.

Alguien puede ayudarme??, gracias.
__________________
Juguetes Sexuales