Code: Select all
<?php include("phpgraphlib.php");
$graph=new PHPGraphLib(500,350);
$data=array("Jan"=>$CatRecjan[0]['saleamount'],"Feb"=>$CatRecfeb[0]['saleamount'],"Mar"=>$CatRecmar[0]['saleamount'],"Apr"=>$CatRecapr[0]['saleamount'],"May"=>$CatRecmay[0]['saleamount'],"Jun"=>$CatRecjun[0]['saleamount'],"Jul"=>$CatRecjul[0]['saleamount'],"Aug"=>$CatRecaug[0]['saleamount'],"Sep"=>$CatRecsep[0]['saleamount'],"Oct"=>$CatRecoct[0]['saleamount'],"Nov"=>$CatRecnov[0]['saleamount'],"Dec"=>$CatRecdec[0]['saleamount']);
$graph->addData($data);
$graph->setTitle("Month Wise Sales Position");
$graph->setGradient("red", "maroon");
$graph->setDataValues(true);
$graph->setDataValueColor("Blue");
$graph->createGraph();
?>
I wrote php tag if i wrote above code in a file without using html tags or table then this is working properly but if i wrot it in tags like
Code: Select all
<html>
<body>
<tr><td>
<?php include("phpgraphlib.php");
$graph=new PHPGraphLib(500,350);
$data=array("Jan"=>$CatRecjan[0]['saleamount'],"Feb"=>$CatRecfeb[0]['saleamount'],"Mar"=>$CatRecmar[0]['saleamount'],"Apr"=>$CatRecapr[0]['saleamount'],"May"=>$CatRecmay[0]['saleamount'],"Jun"=>$CatRecjun[0]['saleamount'],"Jul"=>$CatRecjul[0]['saleamount'],"Aug"=>$CatRecaug[0]['saleamount'],"Sep"=>$CatRecsep[0]['saleamount'],"Oct"=>$CatRecoct[0]['saleamount'],"Nov"=>$CatRecnov[0]['saleamount'],"Dec"=>$CatRecdec[0]['saleamount']);
$graph->addData($data);
$graph->setTitle("Month Wise Sales Position");
$graph->setGradient("red", "maroon");
$graph->setDataValues(true);
$graph->setDataValueColor("Blue");
$graph->createGraph();
?>
</td></tr>
<table>
</table>
</body>
</html>
this is not working properly making garbage value and in mozill gave error
but with out html tags working properly in bothe explorer.
please help