http://www.gerd-tentler.de/tools/phpgraphs/
mi grafico debe mostrar tres barras con los sgtes datos:
ingresos
gastos
superavit
en el label debe aparecer 2000, .... 2006
y los valores son mostrados en valor numerico y % , para aclarar mas el tema,
el 2000 debe tener un valor de ingresos, de gastos y de superavit, idem para todos los años.
el problema que estoy teniendo es que solo me grafica el primer item correpondiente a ingresos y no puedo generar las otras barras..
les dejo mi codigo por si alguien me hecha una mano..gracias..
Código PHP:
<?php
require("../classes/db_mssql_EXT.php");
$db = new DB_MSSQL_EXT;
$db->connect();
$des_ins = $_GET["des_ins"];
$cod_servicio = $_GET["cod_servicio"];
$cod_ins = $_GET["cod_ins"];
$codigo_uno = $_GET["codigo_uno"];
$mes = "";
$sql = "exec PR_SAE_despliega005_2 " . $cod_ins;
$db->query($sql);
while($db->next_record()){
$cod_correlativo = $db->f('cod_correlativo');
$control = $db->f('control');
if($control == 1){
$cod_menu = $db->f('cod_menu');
$correlativo1 = $db->f('correlativo');
$texto1 = $db->f('texto_li_01');
$texto2 = $db->f('texto_li_02');
$valor_01 = $db->f('valor_01');
$valor_02 = $db->f('valor_02');
$format1 = number_format($valor_01,0,'','');
$arreglo1y[] = $format1;
$texto_uno[] = $texto1;
$arreglo1[] = $texto2;
}
if($control == 2){
$cod_menu = $db->f('cod_menu');
$correlativo1 = $db->f('correlativo');
$texto1 = $db->f('texto_li_01');
$texto2 = $db->f('texto_li_02');
$valor_01 = $db->f('valor_01');
$valor_02 = $db->f('valor_02');
$format2 = number_format($valor_01,0,'','');
$arreglo2y[] = $format2;
$texto_dos[] = $texto1;
$arreglo2[] = $texto2;
}
if($control == 3){
$cod_menu = $db->f('cod_menu');
$correlativo1 = $db->f('correlativo');
$texto1 = $db->f('texto_li_01');
$texto2 = $db->f('texto_li_02');
$valor_01 = $db->f('valor_01');
$valor_02 = $db->f('valor_02');
$format3 = number_format($valor_01,0,'','');
$arreglo3y[] = $format3;
$texto_tres[] = $texto1;
$arreglo3[] = $texto2;
}
}
$datay1 = $arreglo1y;
$datay2 = $arreglo2y;
$datay3 = $arreglo3y;
$concepto1 = $arreglo1;
$concepto2 = $arreglo2;
$concepto3 = $arreglo3;
$textouno = $texto_uno;
$textodos = $texto_dos;
$textotres = $texto_tres;
//$graph->values = array(234, 125, 289, 147, 190);
include('graphs.inc.php');
$graph = new BAR_GRAPH("vBar");
$graph->values = array('$datay1','$datay2','$datay3');
$graph->labels = $concepto1;$concepto2;$concepto3;
$graph->legend = $textouno;$textodos;$textotres;
$graph->showValues = 1;
$graph->barWidth = 100;
$graph->barLength = 3.0;
$graph->labelSize = 12;
$graph->absValuesSize = 10;
$graph->percValuesSize = 12;
$graph->graphPadding = 01;
$graph->graphBGColor = "#ffffff";
$graph->graphBorder = "2px solid #83D6AB";
$graph->barColors = "#77E1D9";
$graph->barBGColor = "#ececec";
$graph->barBorder = "2px outset white";
$graph->labelColor = "#000000";
$graph->labelBGColor = "#E1F266";
$graph->labelBorder = "2px groove white";
$graph->absValuesColor = "#000000";
$graph->absValuesBGColor = "#FFFFFF";
$graph->absValuesBorder = "2px groove white";
$graph->labelSpace = 10;
echo $graph->create();
?>
gracias desde ya