|
 |
|
ช่วยดูโค้ดการแสดงกราฟเป็นภาษาไทยด้วนนะค่ะ ไฟล์โค้ดที่ทำ ช่วยดูให้หน่อยนะค่ะ ขอบคุณค่ะ |
|
 |
|
|
 |
 |
|
ไฟล์โค้ดที่ทำ
Code (PHP)
<?php
include ("jpgraph/jpgraph.php");
include ("jpgraph/jpgraph_line.php");
include ("jpgraph/jpgraph_pie.php");
include ("jpgraph/jpgraph_pie3d.php");
include "conn.inc.php";
$SQL="SELECT * FROM averagetime GROUP BY u_user ORDER BY Dtime DESC";
$sqlquery=mysql_db_query($dbname,$SQL);
$num_rows =mysql_num_rows($sqlquery);
$i=0;
while($row=mysql_fetch_array($sqlquery))
{
$xdata[$i]=$row["u_user"];
$ydata[$i]=$row["filetime"];
$i++;
}
//$xdata = array("ต.ค", "พ.ย.", "ธ.ค.", "ม.ค.", "ก.พ.", "มี.ค.","เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.");
//$ydata = array(10,20,5,60,40,100,20,60,80,30,50,120);
$graph = new Graph(800,500,"auto");
$graph->SetScale("textlin");
// Adjust the margin
$graph->img->SetMargin(80,50,50,80);
$graph->SetShadow();
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->mark->SetType(MARK_UTRIANGLE);
$lineplot->value->show();
// Add the plot to the graph
$graph->Add($lineplot);
$graph->title->Set("กราฟเส้น");
$graph->title->SetFont(FF_FONT1,FS_BOLD,20);
$graph->xaxis->title->Set("My User");
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD,20);
$graph->yaxis->title->Set("Time");
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD,20);
$graph->xaxis->SetTickLabels($xdata);
$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(2);
// Display the graph
$graph->Stroke();
?>
ทำตามเว็บนี้บอกแล้วก้อไม่ได้น่ะค่ะ
http://pitaksan.spaces.live.com/blog/cns!30A89FF8A61DCA49!246.entry
และ
http://www.bloggang.com/mainblog.php?id=starnic&month=17-06-2009&group=2&gblog=1
ช่วยดูให้หน่อยนะค่ะ
ขอบคุณค่ะ
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-07-11 17:42:14 |
By :
krataiss |
View :
1807 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากนะค่ะ
ขอให้รวยนะจ้า.....
|
 |
 |
 |
 |
Date :
2009-07-12 10:45:37 |
By :
krataiss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|