![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
<?php
include ("../../jpgraph/src/jpgraph.php");
include ("../../jpgraph/src/jpgraph_bar.php");
$sql="select * from 帐户";
$result=mssql_query($sql,$link);
if($myrow=mssql_fetch_array($result)) {
do
{
$bh=$myrow["编号"];
$array[] = $bh;
}while($myrow=mssql_fetch_array($result));
}
if($result) mssql_free_result($result);
$datay=array(12,8,88.5,3,10,5,68,78,178,128,89,68); (如何利用上面的循环把数组变着这样的形式啊)
// Create the graph. These two calls are always required
$graph = new Graph(500,300,"auto");
$graph->SetScale("textlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('red');
$bplot->value->Show();
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("tes");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_SIMSUN,FS_NORMAL,10);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>

