salve ragazzi spero ci sia qualcuno che possa aiutarmi...ho trovato questo script su internet e lo ho adattato alle mie esigenze, ma quando clicco sul link del grafico mi nonn è possibile visualizzare poichè contiene errori.
Codice PHP:
<?
include("inc/phpgraphlib.php");
include("inc/conn.php");
$codice = $_REQUEST["cod_cliente"];
$cod_cliente = $_REQUEST["cod_cliente"];
$graph=new PHPGraphLib(450,300);
$dataArray=array();
$sql="SELECT `codice`, lettura.*, COUNT(fattura) AS 'count' FROM lettura WHERE codice = ".$codice."";
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
while($row = mysql_fetch_assoc($result))
{
$mese=$row["codice"];
$count=$row["fattura"];
//ADD TO ARRAY
$dataArray[$mese]=$count;
}
$graph->addData($dataArray);
$graph->setBackgroundColor("black");
$graph->setBarColor("white", "red", "blue");
$graph->setTitle("Budget riassuntivo");
$graph->setTitleLocation("left");
$graph->setLegend(true);
$graph->setLegendTitle("Previsto", "Pianificato", "Reale");
$graph->setTitleColor("yellow");
$graph->setupYAxis(12, "yellow");
$graph->setupXAxis(20, "yellow");
$graph->setGrid(false);
//$graph->setGoalLine(60);
//$graph->setGoalLineColor("yellow");
$graph->setBarOutlineColor("white");
$graph->setTextColor("white");
$graph->createGraph();
?>
altro file che richiama il grafico
Codice PHP:
<h3>Grafico Riassuntivo Annuo</h3>
<a href="graph.php"</a></p>