Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/09/2005, 12:41
Avatar de ADIÓS_ADRIANA
ADIÓS_ADRIANA
 
Fecha de Ingreso: septiembre-2005
Mensajes: 263
Antigüedad: 18 años, 7 meses
Puntos: 0
Otras 2 Preguntas de Jpgraph

Bien, ya tengo funcionando la jpgraph y he revisado la referencia, pero la verdad no encuentro nada acerca de:

1. Como hacer auto expandible el tamaño de la imgen, es decir sin tener que colocar un valor fijo.

2. Como colocar junto a los porcentages el valor numérico.

Dejo el Script y el gráfico.

Saludos y Gracias desde ya.







Código PHP:
<?php 
include ("../../jpgraph/src/jpgraph.php");
include (
"../../jpgraph/src/jpgraph_pie.php");
include (
"../../jpgraph/src/jpgraph_pie3d.php");


            
$host="localhost"
            
$user="root"
            
$password=""
            
mysql_connect($host,$user,$password); 
$result mysql_db_query("bdatos","select country, count(provider_id)as total from provider group by country order by total DESC Limit 10"); 
while(
$row mysql_fetch_array($result)) 

//echo $row["total"]; 
$arreglo1[] = $row[0]; 
$arreglo2[] = $row[1]; 

//$gJpgBrandTiming=true; 

$data $arreglo2;

// Create the Pie Graph.
$graph = new PieGraph(550,300,"auto"); //<--------Aqui es lo del tamaño
$graph->SetShadow();

// Set A title for the plot
$graph->title->Set("Providers");
$graph->title->SetFont(FF_FONT1,FS_BOLD); 
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.02,0.2);

// Create pie plot
$p1 = new PiePlot3d($data);
$p1->SetTheme("sand");
$p1->SetCenter(0.35);
$p1->SetAngle(30);
$p1->value->SetFont(FF_ARIAL,FS_NORMAL);
$p1->SetLegends($arreglo1);

$p1->SetCSIMTargets($row[0],$row[1]);

$graph->Add($p1);
$graph->Stroke();

?>