A-AA+then

ดูโค้ดกราฟให้หน่อยค่ะไม่รู้ผิดตรงไหน

1,370

<?
ob_start();
session_start();
if(empty($u_user))// ตรวจสอบว่าผ่านการ login หรือไม่
{
header("location:report.php");
exit();
}
?>

<?
include ("jpgraph/jpgraph.php");
include ("jpgraph/jpgraph_line.php");

include "conn.inc.php";
$SQL="SELECT * FROM filedata WHERE u_user = '$u_user' GROUP BY filename ";
$sqlquery=mysql_db_query($dbname,$SQL);
$num_rows =mysql_num_rows($sqlquery);
$i=0;
while($row=mysql_fetch_array($sqlquery))
{
$xdata[$i]=$row["filename"];
$ydata[$i]=$row["timespent"];
$i++;
}

$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);
$title = iconv('TIS-620','UTF-8',"คุณ$u_user");
$graph->title->Set($title);
$graph->title->SetFont(FF_ANGSA,FS_BOLD,20);
$xtitle = iconv('TIS-620','UTF-8',"ชุดงาน");
$graph->xaxis->title->Set($xtitle);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD,20);
$graph->yaxis->title->Set("Time");
$graph->xaxis->title->SetFont(FF_ANGSA,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();
?>

 

1 ความคิดเห็น

ถ้าบอกอาการมาด้วยหมอคงวินิจฉัยได้เร็วขึ้น
1
^