|
 |
|
ใช้ jgraph แล้วเป็นแบบนี้ไม่แสดงรูปกราฟให้เห็นครับช่วยที |
|
 |
|
|
 |
 |
|

show_graph.php
<?php
include ("Jgraph/jpgraph.php");
include ("Jgraph/jpgraph_bar.php");
include ("Jgraph/jpgraph_line.php");
// ติดต่อ ฐานข้อมูล เลือกข้อมูลขึ้นมาเพื่อแสดงกราฟ
$objConnect = mysql_connect("localhost","root","12345") or die("Error Connect to Database");
$objDB = mysql_select_db("cat_system");
$strSQL = "SELECT repair_info.check1,repair_info.check2,repair_info.check3,repair_info.check4 FROM repair_info";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
// เตรียมข้อมุลที่จะแสดง เพื่อสร้างกราฟ
$datay=array();
while($objResult = mysql_fetch_array($objQuery))
{
$datay[] = $objResult["check1"];
}
// Create the graph.
$graph = new Graph(350,300);
$graph->SetScale("textlin");
$graph->SetMarginColor('navy:1.9');
$graph->SetBox();
$graph->title->Set('Bar Pattern');
$graph->title->SetFont(FF_ARIAL,FS_BOLD,20);
$graph->SetTitleBackground('lightblue:1.3',TITLEBKG_STYLE2,TITLEBKG_FRAME_BEVEL);
$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'lightblue','blue');
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor('darkorange');
$bplot->SetWidth(0.6);
$bplot->SetPattern(PATTERN_CROSS1,'navy');
$graph->Add($bplot);
$graph->Stroke();
?>
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2013-01-28 00:39:59 |
By :
luk101 |
View :
863 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จาก Error เหมือนกับว่ามันมีค่าที่ไม่ใช่ตัวเลขน่ะครับ
|
 |
 |
 |
 |
Date :
2013-01-28 20:08:38 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|