Problemas con jpgrahp
Estimado experto muchas gracias por tu tiempo estoy tratando de hacer un grafico dinamico con jpgrahp y le dado 1000 vueltas no he podido dar el error que me esta dando es "jpgraph error 25044 te adjunto mi codigo para que veas la consulta sql yo creo que por hay va
<?php // content="text/plain; charset=utf-8"
// Example for use of JpGraph,
//require_once ("jpgraph/src/jpgraph.php")
require_once ('jpgraph/src/jpgraph.php');
require_once ('jpgraph/src/jpgraph_bar.php');
$con=mysql_connect("localhost","admin","admin");
mysql_select_db("soporte");
$res=mysql_query("select * from ingresos");
$tot1=mysql_query("select sin_det from ingresos");
// We need some data
$datay=array($tot1);
$datax=array("January","February","March","April","May","June");
// Setup the graph.
$graph = new Graph(400,240);
$graph->img->SetMargin(60,20,35,75);
$graph->SetScale("textlin");
$graph->SetMarginColor("lightblue:1.1");
$graph->SetShadow();
// Set up the title for the graph
$graph->title->Set("Bar gradient with left reflection");
$graph->title->SetMargin(8);
$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($datax);
$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();
?>
<?php // content="text/plain; charset=utf-8"
// Example for use of JpGraph,
//require_once ("jpgraph/src/jpgraph.php")
require_once ('jpgraph/src/jpgraph.php');
require_once ('jpgraph/src/jpgraph_bar.php');
$con=mysql_connect("localhost","admin","admin");
mysql_select_db("soporte");
$res=mysql_query("select * from ingresos");
$tot1=mysql_query("select sin_det from ingresos");
// We need some data
$datay=array($tot1);
$datax=array("January","February","March","April","May","June");
// Setup the graph.
$graph = new Graph(400,240);
$graph->img->SetMargin(60,20,35,75);
$graph->SetScale("textlin");
$graph->SetMarginColor("lightblue:1.1");
$graph->SetShadow();
// Set up the title for the graph
$graph->title->Set("Bar gradient with left reflection");
$graph->title->SetMargin(8);
$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($datax);
$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();
?>
1 Respuesta
Respuesta de Jorge Vila
1