Ver Mensaje Individual
  #8 (permalink)  
Antiguo 10/06/2011, 10:39
Avatar de HerbyBocho
HerbyBocho
 
Fecha de Ingreso: mayo-2011
Ubicación: Chihuahua, Chihuahua, Mexico
Mensajes: 52
Antigüedad: 12 años, 10 meses
Puntos: 1
Respuesta: 4 graficas juntas

bueno aqui les muestro el codigo (uno de estados y otro de unidades):

ESTE ES EL DE ''CALIFICACIONES POR UNIDAD''
Código PHP:
Ver original
  1. <?php // content="text/plain; charset=utf-8"
  2. require_once ('grafica/jpgraph.php');
  3. require_once ('grafica/jpgraph_bar.php');
  4. include_once ('clase_grafica.php');
  5.     $unidad1;
  6.     $unidad2;
  7.     $unidad3;
  8.     $unidad4;
  9.     $unidad5;
  10.     $unidad6;
  11.  
  12. $data1y=array($unidad1,$unidad2,$unidad3,$unidad4,$unidad5,$unidad6);
  13.  
  14.  
  15. // Create the graph. These two calls are always required
  16. $graph = new Graph(500,350,'auto');
  17. $graph->SetScale("textlin");
  18.  
  19. $theme_class=new UniversalTheme;
  20. $graph->SetTheme($theme_class);
  21.  
  22. $graph->yaxis->SetTickPositions(array(0,10,20,30,40,50,60,70,80,90,100), array(5,15,25,35,45,55,65,75,85,95));
  23. $graph->SetBox(false);
  24.  
  25. $graph->ygrid->SetFill(true);
  26. $graph->xaxis->SetTickLabels(array('Unidad 1','Unidad 2','Unidad 3','Unidad 4','Unidad 5','Unidad 6'));
  27. $graph->yaxis->HideLine(false);
  28. $graph->yaxis->HideTicks(false,false);
  29.  
  30. // Create the bar plots
  31. $b1plot = new BarPlot($data1y);
  32.  
  33. // Create the grouped bar plot
  34. $gbplot = new GroupBarPlot(array($b1plot));
  35. // ...and add it to the graPH
  36. $graph->Add($gbplot);
  37. $graph->Add($gbplot);
  38. $b1plot->SetColor("white");
  39. $b1plot->SetFillGradient("#4B0082","white",GRAD_LEFT_REFLECTION);
  40. $b1plot->SetWidth(45);
  41. $b1plot->SetFillColor("#cc1111");
  42. $graph->title->Set("Bar Gradient(Left reflection)");
  43. $graph->title->Set("PROMEDIO DE CALIFICACIONES POR UNIDAD");
  44.  
  45. // Display the graph
  46. $graph->Stroke();
  47. ?>


Y ESTE ES EL DE CALIFICACIONES POR ESTADO:
Código PHP:
Ver original
  1. <?php // content="text/plain; charset=utf-8"
  2. require_once ('grafica/jpgraph.php');
  3. require_once ('grafica/jpgraph_bar.php');
  4. include_once ('clase_grafica3.php');
  5. $data1y=array($Aguascalientes,$BajaCalifornia,$BajaCaliforniaSur,$Campeche,$Chiapas,$Chihuahua,$Coahuila,$Colima,$DistritoFederal,$Durango,$Guanajuato,$Guerrero,$Hidalgo,$Jalisco,$Mexico,$Michoacan,$Morelos,$Nayarit,$NuevoLeon,$Oaxaca,$Puebla,$Queretaro,$QuintanaRoo,$SanLuisPotosi,$Sinaloa,$Sonora,$Tabasco,$Tamaulipas,$Tlaxcala,$Veracruz,$Yucatan,$Zacatecas);
  6.  
  7. // Create the graph. These two calls are always required
  8. $graph = new Graph(1500,700,'auto');
  9. $graph->SetScale("textlin");
  10.  
  11. $theme_class=new UniversalTheme;
  12. $graph->SetTheme($theme_class);
  13.  
  14. $graph->yaxis->SetTickPositions(array(0,10,20,30,40,50,60,70,80,90,100),array(5,15,25,35,45,55,65,75,85,95));
  15. $graph->SetBox(true);
  16.  
  17. $graph->ygrid->SetFill(true);
  18. $graph->xaxis->SetTickLabels(array('Agsc','BjC','BjCS','Cmpe','Chpas','Chih','Cohla','Clma','DF','Dngo','Gjto','Grro','Hdlgo','Jlco','Mex','Mchcan','Mrls','Naya','NL','Oxca','Pbla','Qtaro','QRoo','SanLP','Snloa','Snra','Tbsco','Tmalpas','Txla','Vruz','Yuc','Ztcas'));
  19. $graph->yaxis->HideLine(false);
  20. $graph->yaxis->HideTicks(false,false);
  21.  
  22. // Create the bar plots
  23. $b1plot = new BarPlot($data1y);
  24.  
  25. // Create the grouped bar plot
  26. $gbplot = new GroupBarPlot(array($b1plot));
  27. // ...and add it to the graPH
  28. $graph->Add($gbplot);
  29. $b1plot->SetColor("white");
  30. $b1plot->SetFillGradient("#4B0082","white",GRAD_LEFT_REFLECTION);
  31. $b1plot->SetWidth(45);
  32. $b1plot->SetFillColor("#cc1111");
  33. $graph->title->Set("Bar Gradient(Left reflection)");
  34. $graph->title->Set("PROMEDIO DE CALIFICACIONES POR ESTADO");
  35.  
  36. // Display the graph
  37. $graph->Stroke();
  38. ?>

las otras dos no las puse porque tienen exactamente ''casi'' lo mismo, no mas quise dar un ejemplo de cada uno...bueno gracias por darme la mano compadres!