|
![](/images/resource/spacer.gif) |
|
นำ JPGRAPH มาแสดงผลในส่วนของ Tag <body> แล้วฟ้อง error ครับ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
![error2 error2](https://www.thaicreate.com/upload/stock/20161129112555.png?v=1001)
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
require_once("jpgraph/jpgraph.php");
require_once("jpgraph/jpgraph_bar.php");
$ydata1=array(20,15,18,22,24,26,28);
$ydata2=array(10,20,25,30,17,18,30);
$xdata1=array("Jan","Feb","Mar","Apr","May","Jun","Jul");
$mygraph=new Graph(500,350,"auto");
$mygraph->SetScale("textlin");
$mygraph->title->Set("TestPlotgraph");
$mygraph->xaxis->title->Set("Month");
$mygraph->yaxis->title->Set("Point");
$mygraph->xaxis->SetTickLabels($xdata1);
$line1=new BarPlot($ydata1);
$line2=new BarPlot($ydata2);
$line1->SetColor("red");
$line2->SetColor("blue");
//$line2->value->SetFormat('%d');
$line2->SetFillGradient('blue','white',GRAD_MIDVER);
$line1->value->Show();
$line1->SetLegend('2558');
$line2->SetLegend('2559');
$line2->value->Show();
$gbplot=new GroupBarPlot(array($line1,$line2));
$mygraph->Add($gbplot);
$mygraph->Stroke();
?>
</body>
</html>
Tag : PHP, MySQL
![](/images/adv.jpg?v=1001)
|
ประวัติการแก้ไข 2016-11-29 11:23:07 2016-11-29 11:26:28
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2016-11-29 11:20:25 |
By :
ecom490 |
View :
829 |
Reply :
5 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ถ้าไม่ใส่ tag HTML ก็แสดงผลได้ปกติครับ
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2016-11-29 11:21:47 |
By :
ecom490 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
แล้วถ้าย้ายตำแหน่งแบบนี้ได้ไหมครับ
<?php
require_once("jpgraph/jpgraph.php");
require_once("jpgraph/jpgraph_bar.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
//require_once("jpgraph/jpgraph.php");
//require_once("jpgraph/jpgraph_bar.php");
$ydata1=array(20,15,18,22,24,26,28);
$ydata2=array(10,20,25,30,17,18,30);
$xdata1=array("Jan","Feb","Mar","Apr","May","Jun","Jul");
$mygraph=new Graph(500,350,"auto");
$mygraph->SetScale("textlin");
$mygraph->title->Set("TestPlotgraph");
$mygraph->xaxis->title->Set("Month");
$mygraph->yaxis->title->Set("Point");
$mygraph->xaxis->SetTickLabels($xdata1);
$line1=new BarPlot($ydata1);
$line2=new BarPlot($ydata2);
$line1->SetColor("red");
$line2->SetColor("blue");
//$line2->value->SetFormat('%d');
$line2->SetFillGradient('blue','white',GRAD_MIDVER);
$line1->value->Show();
$line1->SetLegend('2558');
$line2->SetLegend('2559');
$line2->value->Show();
$gbplot=new GroupBarPlot(array($line1,$line2));
$mygraph->Add($gbplot);
$mygraph->Stroke();
?>
</body>
</html>
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2016-11-29 13:40:51 |
By :
apisitp |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ขอบคุณ Mr.กล้าครับ
วิธีการนี้ผมลองดูแล้ว มันก็ยัง ERROR เหมือนเดิมครับ
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2016-11-29 15:30:31 |
By :
ecom490 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ตัวนี้ก็ไม่เคยเล่นด้วย เห็นมีหนังสือขายอยู่แต่ดูแล้วยุ่งยากเลยไม่ไปยุ่ง
ถ้าปรับได้อยากแนะนำ ให้ไปดู ปลั๊กอินสร้างกราฟทาง jquery ดูครับ ใช้งานง่าย ไม่ยาก หาดูแบบแยกส่วนก็เยอะ หลายแบบ
หรือจะหาแบบรวม ๆ ก็พวก admin dashboard template
ลองหลายๆทางครับ
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2016-11-29 16:09:29 |
By :
apisitp |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ขอบคุณสำหรับคำแนะนำดี ๆ ครับ
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2016-11-30 14:08:37 |
By :
ecom490 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 05
|