jpgraph ไม่แสดงภาษาไทยในส่วนข้อมูล
Moderator: mindphp, ผู้ดูแลกระดาน
-
- PHP Newbie
- โพสต์: 6
- ลงทะเบียนเมื่อ: 07/04/2009 1:33 pm
jpgraph ไม่แสดงภาษาไทยในส่วนข้อมูล
<?php
include ("src/jpgraph.php");
include ("src/jpgraph_bar.php");
$title = iconv('TIS-620','UTF-8',"สถิติผู้รับบริการประจำปี 2551");
$SetLegend = iconv('TIS-620','UTF-8',"จำนวนผู้ป่วยใน");
$SetLegend2 = iconv('TIS-620','UTF-8',"จำนวนผู้ป่วนนอก");
$x = iconv('TIS-620','UTF-8',"เดือน");
$y = iconv('TIS-620','UTF-8',"จำนวนคน");
// Create the graph. These two calls are always required
$ydata = array(0,30,44,28,60,38);
$xdata = array("มกราคม", "ก.พ.", "มีนาคม", "เมษา", "พฤษภา", "มิถุนา");
for($i=0;$i<=5;$i++){
$xdata[] = iconv('TIS-620','UTF-8','$xdata[$i]');
}
$pic="graph.jpg";
/*สร้างกราฟโดยใช้ 2 ฟังก์ชัน โดย 2 บรรทัดนี้จำเป็นมากขาดไม่ได้ บรรทัดแรกเป็นการสร้างกราฟใหม่ขนาด 480x360 บรรทัดที่สอง เป็นการเซ็ตสเกลแบบแกน X ค่าเป็นตัวหนังสือ แกน Y เป็นตัวเลขแบบต่อเนื่อง */
$mygraph = new Graph(560,360);
$mygraph->SetScale("textlin", 0, 100);
$mygraph->tabtitle->SetTabAlign('right');
//กำหนดประเภทของฟ้อนต์ให้กับไตเติ้ลของกราฟ
$mygraph->tabtitle->SetFont(FF_FONT2,FS_BOLD);
//กำหนดสีให้กับไตเติ้ลของกราฟ
$mygraph->tabtitle->SetColor("maroon1");
$mygraph->title->Set($title);
$mygraph->title->SetFont(FF_TAHOMA, FS_BOLD, 15);
//กำหนดประเภทของฟ้อนต์ให้กับตัวหนังสือที่ใช้กับแกน Y
$mygraph->yaxis->title->SetFont(FF_TAHOMA, FS_BOLD, 10);
//กำหนดประเภทของฟ้อนต์ให้กับตัวหนังสือที่ใช้กับแกน X
$mygraph->xaxis->title->SetFont(FF_TAHOMA, FS_BOLD, 10);
$mygraph->xaxis->title->Set($x);
$mygraph->yaxis->title->Set($y);
$mygraph->xaxis->SetFont(FF_TAHOMA, FS_NORMAL, 10);
$mygraph->xaxis->SetTickLabels($xdata);****
//กำหนดให้รูปให้มีเงาอยู่ด้านหลัง
$mygraph->SetShadow();
//ปรับระยะห่างระหว่างขอบกราฟกับขอบรูปภาพ
$mygraph->SetMargin(50, 50, 40 , 60);
//กำหนดสีให้กับระยะห่างของขอบกราฟกับขอบรูปภาพ
$mygraph->SetMarginColor("greenyellow");
//กำหนดสีของแกน
$mygraph->xaxis->SetColor('blue');
$mygraph->yaxis->SetColor('blue','red');
//กำหนดความหนาของแกน
$mygraph->yaxis->SetWeight(2);
//กำหนดประเภทของฟ้อนต์ให้กับค่าต่างๆ ของแกน X
$mygraph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,10);
//ปรับตัวหนังสือที่บอกค่าต่างๆ ของแกน X ให้เอียง 90 องศา
$mygraph->xaxis->SetLabelAngle(90);
//ปรับระยะห่างระหว่างตัวหนังสือที่บอกค่าของแกน X กับแกน X
$mygraph->xaxis->SetLabelMargin(8);
//ปรับระยะห่างของชื่อแกน X กับ แกน X
$mygraph->xaxis->SetTitlemargin(15);
// กราฟแท่งที่หนึ่ง
$bplot1 = new BarPlot($ydata);
$bplot1->value->Show();
$bplot1->value->SetFormat('%d');
$bplot1->SetFillGradient("blue", "cyan", GRAD_MIDVER);
$bplot1->SetLegend($SetLegend);
//ข้อมูลและกราฟแท่งที่สอง
$ydata2 = array(30,91,68,77,38,13);
$bplot2 = new BarPlot($ydata2);
$bplot2->value->Show();
$bplot2->value->SetFormat('%d');
$bplot2->SetFillGradient('red', 'gold', GRAD_MIDVER);
$bplot2->SetLegend($SetLegend2);
// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($bplot1,$bplot2));
//เพิ่มแท่งกราฟเข้าไปในเฟรม
$mygraph->Add($gbplot);
//แสดงผลรูปกราฟ
$mygraph->Stroke($pic);
echo "<img src='$pic'>";
?>
ตรงข้อมูลใต้แกน x อะครับมะยอมเปงภาษาไทย
include ("src/jpgraph.php");
include ("src/jpgraph_bar.php");
$title = iconv('TIS-620','UTF-8',"สถิติผู้รับบริการประจำปี 2551");
$SetLegend = iconv('TIS-620','UTF-8',"จำนวนผู้ป่วยใน");
$SetLegend2 = iconv('TIS-620','UTF-8',"จำนวนผู้ป่วนนอก");
$x = iconv('TIS-620','UTF-8',"เดือน");
$y = iconv('TIS-620','UTF-8',"จำนวนคน");
// Create the graph. These two calls are always required
$ydata = array(0,30,44,28,60,38);
$xdata = array("มกราคม", "ก.พ.", "มีนาคม", "เมษา", "พฤษภา", "มิถุนา");
for($i=0;$i<=5;$i++){
$xdata[] = iconv('TIS-620','UTF-8','$xdata[$i]');
}
$pic="graph.jpg";
/*สร้างกราฟโดยใช้ 2 ฟังก์ชัน โดย 2 บรรทัดนี้จำเป็นมากขาดไม่ได้ บรรทัดแรกเป็นการสร้างกราฟใหม่ขนาด 480x360 บรรทัดที่สอง เป็นการเซ็ตสเกลแบบแกน X ค่าเป็นตัวหนังสือ แกน Y เป็นตัวเลขแบบต่อเนื่อง */
$mygraph = new Graph(560,360);
$mygraph->SetScale("textlin", 0, 100);
$mygraph->tabtitle->SetTabAlign('right');
//กำหนดประเภทของฟ้อนต์ให้กับไตเติ้ลของกราฟ
$mygraph->tabtitle->SetFont(FF_FONT2,FS_BOLD);
//กำหนดสีให้กับไตเติ้ลของกราฟ
$mygraph->tabtitle->SetColor("maroon1");
$mygraph->title->Set($title);
$mygraph->title->SetFont(FF_TAHOMA, FS_BOLD, 15);
//กำหนดประเภทของฟ้อนต์ให้กับตัวหนังสือที่ใช้กับแกน Y
$mygraph->yaxis->title->SetFont(FF_TAHOMA, FS_BOLD, 10);
//กำหนดประเภทของฟ้อนต์ให้กับตัวหนังสือที่ใช้กับแกน X
$mygraph->xaxis->title->SetFont(FF_TAHOMA, FS_BOLD, 10);
$mygraph->xaxis->title->Set($x);
$mygraph->yaxis->title->Set($y);
$mygraph->xaxis->SetFont(FF_TAHOMA, FS_NORMAL, 10);
$mygraph->xaxis->SetTickLabels($xdata);****
//กำหนดให้รูปให้มีเงาอยู่ด้านหลัง
$mygraph->SetShadow();
//ปรับระยะห่างระหว่างขอบกราฟกับขอบรูปภาพ
$mygraph->SetMargin(50, 50, 40 , 60);
//กำหนดสีให้กับระยะห่างของขอบกราฟกับขอบรูปภาพ
$mygraph->SetMarginColor("greenyellow");
//กำหนดสีของแกน
$mygraph->xaxis->SetColor('blue');
$mygraph->yaxis->SetColor('blue','red');
//กำหนดความหนาของแกน
$mygraph->yaxis->SetWeight(2);
//กำหนดประเภทของฟ้อนต์ให้กับค่าต่างๆ ของแกน X
$mygraph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,10);
//ปรับตัวหนังสือที่บอกค่าต่างๆ ของแกน X ให้เอียง 90 องศา
$mygraph->xaxis->SetLabelAngle(90);
//ปรับระยะห่างระหว่างตัวหนังสือที่บอกค่าของแกน X กับแกน X
$mygraph->xaxis->SetLabelMargin(8);
//ปรับระยะห่างของชื่อแกน X กับ แกน X
$mygraph->xaxis->SetTitlemargin(15);
// กราฟแท่งที่หนึ่ง
$bplot1 = new BarPlot($ydata);
$bplot1->value->Show();
$bplot1->value->SetFormat('%d');
$bplot1->SetFillGradient("blue", "cyan", GRAD_MIDVER);
$bplot1->SetLegend($SetLegend);
//ข้อมูลและกราฟแท่งที่สอง
$ydata2 = array(30,91,68,77,38,13);
$bplot2 = new BarPlot($ydata2);
$bplot2->value->Show();
$bplot2->value->SetFormat('%d');
$bplot2->SetFillGradient('red', 'gold', GRAD_MIDVER);
$bplot2->SetLegend($SetLegend2);
// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($bplot1,$bplot2));
//เพิ่มแท่งกราฟเข้าไปในเฟรม
$mygraph->Add($gbplot);
//แสดงผลรูปกราฟ
$mygraph->Stroke($pic);
echo "<img src='$pic'>";
?>
ตรงข้อมูลใต้แกน x อะครับมะยอมเปงภาษาไทย
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41230
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: jpgraph ไม่แสดงภาษาไทยในส่วนข้อมูล
มีรูปผลที่ได้ตอนนี้ ได้ไหมครับ
และใช้ เวอร์ชั่นอะไร
และใช้ เวอร์ชั่นอะไร
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- PHP Newbie
- โพสต์: 6
- ลงทะเบียนเมื่อ: 07/04/2009 1:33 pm
Re: jpgraph ไม่แสดงภาษาไทยในส่วนข้อมูล
ผมลองมั่วๆ จนได้ละคราบบบ -.-
แต่มีปัญหามาใหม่แทน jpgraph เปงไรที่ปวดหัวดีจิงๆ
มันขึ้น
JpGraph Error Either X or Y data arrays contains non-numeric values. Check that the data is really specified as numeric data and not as strings. It is an error to specify data for example as '-2345.2' (using quotes).
แบบนี้อะครับ
เปงที่ไรอ่า มันเปงโค๊ดชุดนี้ครับ
$dtebg = $ybg.'0101';
$dteed = $ybg.'1231';
$lstmth='';
$tot[1] = 0;$tot[2] = 0;$tot[3] = 0;$tot[4] = 0;$tot[5] = 0;$tot[6] = 0;$tot[7] = 0;$tot[8] = 0;$tot[9] = 0;$tot[10] = 0;$tot[11] = 0;$tot[12] = 0;
$sql = "select * FROM OPDALLV5PF WHERE OALDTE between $dtebg and $dteed and OALFLG = '' AND OALWRDNO = '' order by OALDTE " ;
$rs = odbc_exec($conn,$sql);
while($row = odbc_fetch_array($rs)) {
$j = substr($row["OALDTE"],4,2);
$tot[$j] = $tot[$j] + $row["OALQTYOPD"];
$ipd[$j] = $ipd[$j] + $row["OALQTYADO"] + $row["OALQTYADN"];
$opd[$j] = $tot[$j] - $ipd[$j];
}
$num=01;
while($num <= 12) {
if(strlen($num) == 1)
$num = '0'.$num;
$opd = $tot[$num] - $ipd[$num];
//$lstmonth=chang_month($num);
$num++;
}
$ydata = array(chknum($tot[10]),5220);
พอใส่ค่าตรงตัวแดงไปอ่าครับ จาขึ้น error แบบข้างบน
ในความคิดผมคิดว่า เลขที่ดึงมาจากฐาน มันเปงเลขที่jpgraph มะsupport รึป่าวอะครับ
ต้อง covert ค่าก่องรึป่าวอะครับ
แต่มีปัญหามาใหม่แทน jpgraph เปงไรที่ปวดหัวดีจิงๆ
มันขึ้น
JpGraph Error Either X or Y data arrays contains non-numeric values. Check that the data is really specified as numeric data and not as strings. It is an error to specify data for example as '-2345.2' (using quotes).
แบบนี้อะครับ
เปงที่ไรอ่า มันเปงโค๊ดชุดนี้ครับ
$dtebg = $ybg.'0101';
$dteed = $ybg.'1231';
$lstmth='';
$tot[1] = 0;$tot[2] = 0;$tot[3] = 0;$tot[4] = 0;$tot[5] = 0;$tot[6] = 0;$tot[7] = 0;$tot[8] = 0;$tot[9] = 0;$tot[10] = 0;$tot[11] = 0;$tot[12] = 0;
$sql = "select * FROM OPDALLV5PF WHERE OALDTE between $dtebg and $dteed and OALFLG = '' AND OALWRDNO = '' order by OALDTE " ;
$rs = odbc_exec($conn,$sql);
while($row = odbc_fetch_array($rs)) {
$j = substr($row["OALDTE"],4,2);
$tot[$j] = $tot[$j] + $row["OALQTYOPD"];
$ipd[$j] = $ipd[$j] + $row["OALQTYADO"] + $row["OALQTYADN"];
$opd[$j] = $tot[$j] - $ipd[$j];
}
$num=01;
while($num <= 12) {
if(strlen($num) == 1)
$num = '0'.$num;
$opd = $tot[$num] - $ipd[$num];
//$lstmonth=chang_month($num);
$num++;
}
$ydata = array(chknum($tot[10]),5220);
พอใส่ค่าตรงตัวแดงไปอ่าครับ จาขึ้น error แบบข้างบน
ในความคิดผมคิดว่า เลขที่ดึงมาจากฐาน มันเปงเลขที่jpgraph มะsupport รึป่าวอะครับ
ต้อง covert ค่าก่องรึป่าวอะครับ
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41230
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: jpgraph ไม่แสดงภาษาไทยในส่วนข้อมูล
ถ้าเป็นตัวเลข จริงๆ jpgraph นำมาใช้ได้อยู่แล้วครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- PHP Newbie
- โพสต์: 6
- ลงทะเบียนเมื่อ: 07/04/2009 1:33 pm
Re: jpgraph ไม่แสดงภาษาไทยในส่วนข้อมูล
มันแสดงเป็นตัวเลขนะครับ ตอนผม echo ออกมาดูอะ
แต่ว่ามันขึ้น error เปงที่ไรง่ะ
data type มันเปง numeric อะครับ ลองเปลี่ยนเป็น int แล้วนะ แต่ก็ error เหมือนเดิมอะครับ
แล้วงี้ผมจาแก้ไงอ่าครับ งงมั่กๆ
เหมือนข้อมูลจาไม่ใช่ตัวเลขจิงๆอะครับ แต่แก้มะเปงอ่า ทำไงอะครับ
ขอบคุณครับ
แต่ว่ามันขึ้น error เปงที่ไรง่ะ
data type มันเปง numeric อะครับ ลองเปลี่ยนเป็น int แล้วนะ แต่ก็ error เหมือนเดิมอะครับ
แล้วงี้ผมจาแก้ไงอ่าครับ งงมั่กๆ
เหมือนข้อมูลจาไม่ใช่ตัวเลขจิงๆอะครับ แต่แก้มะเปงอ่า ทำไงอะครับ
ขอบคุณครับ
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41230
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: jpgraph ไม่แสดงภาษาไทยในส่วนข้อมูล
ค่าไหน ล่ะครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- PHP Newbie
- โพสต์: 6
- ลงทะเบียนเมื่อ: 07/04/2009 1:33 pm
Re: jpgraph ไม่แสดงภาษาไทยในส่วนข้อมูล
ค่าตัวนี้อะครับ chknum($tot[10])
มันมี function อยู่ด้วยนะครับ ข้างบน เอามาเพื่อไว้มันอาจเกี่ยวกัน
function chknum($dt){
if($dt == 0) $ans = '';
else $ans = number_format($dt,0,".",",");
return $ans;
}
ติดตรงนี้ที่เดียวเลย มะงั้นกราฟผมจาสมบูรณ์ละทำมาจาอาทิตย์ละ อิอิ
ถ้าข้อมูลขาดบอกได้นะครับ
ค่าของตัว chknum($tot[10]) มันได้ 13,150 อะครับ แต่ลง jpgraph มะได้ งงมั่กๆ
มันมี function อยู่ด้วยนะครับ ข้างบน เอามาเพื่อไว้มันอาจเกี่ยวกัน
function chknum($dt){
if($dt == 0) $ans = '';
else $ans = number_format($dt,0,".",",");
return $ans;
}
ติดตรงนี้ที่เดียวเลย มะงั้นกราฟผมจาสมบูรณ์ละทำมาจาอาทิตย์ละ อิอิ
ถ้าข้อมูลขาดบอกได้นะครับ
ค่าของตัว chknum($tot[10]) มันได้ 13,150 อะครับ แต่ลง jpgraph มะได้ งงมั่กๆ
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41230
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: jpgraph ไม่แสดงภาษาไทยในส่วนข้อมูล
string number_format ( float $number [, int $decimals ] )
function นี้มันจะคืนว่าเป็น string ครับ
convert มันกลับเป็น int หรือ float ซิครับ
function นี้มันจะคืนว่าเป็น string ครับ
convert มันกลับเป็น int หรือ float ซิครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- PHP Newbie
- โพสต์: 6
- ลงทะเบียนเมื่อ: 07/04/2009 1:33 pm
Re: jpgraph ไม่แสดงภาษาไทยในส่วนข้อมูล
ได้ละครับ ขอบคุณคราบบบบบบบบบ
Re: jpgraph ไม่แสดงภาษาไทยในส่วนข้อมูล
JpGraph Error: 25111 Can't delete cached image graph1.jpg. Permission problem?babekung เขียน:<?php
include ("src/jpgraph.php");
include ("src/jpgraph_bar.php");
$title = iconv('TIS-620','UTF-8',"สถิติผู้รับบริการประจำปี 2551");
$SetLegend = iconv('TIS-620','UTF-8',"จำนวนผู้ป่วยใน");
$SetLegend2 = iconv('TIS-620','UTF-8',"จำนวนผู้ป่วนนอก");
$x = iconv('TIS-620','UTF-8',"เดือน");
$y = iconv('TIS-620','UTF-8',"จำนวนคน");
// Create the graph. These two calls are always required
$ydata = array(0,30,44,28,60,38);
$xdata = array("มกราคม", "ก.พ.", "มีนาคม", "เมษา", "พฤษภา", "มิถุนา");
for($i=0;$i<=5;$i++){
$xdata[] = iconv('TIS-620','UTF-8','$xdata[$i]');
}
$pic="graph.jpg";
/*สร้างกราฟโดยใช้ 2 ฟังก์ชัน โดย 2 บรรทัดนี้จำเป็นมากขาดไม่ได้ บรรทัดแรกเป็นการสร้างกราฟใหม่ขนาด 480x360 บรรทัดที่สอง เป็นการเซ็ตสเกลแบบแกน X ค่าเป็นตัวหนังสือ แกน Y เป็นตัวเลขแบบต่อเนื่อง */
$mygraph = new Graph(560,360);
$mygraph->SetScale("textlin", 0, 100);
$mygraph->tabtitle->SetTabAlign('right');
//กำหนดประเภทของฟ้อนต์ให้กับไตเติ้ลของกราฟ
$mygraph->tabtitle->SetFont(FF_FONT2,FS_BOLD);
//กำหนดสีให้กับไตเติ้ลของกราฟ
$mygraph->tabtitle->SetColor("maroon1");
$mygraph->title->Set($title);
$mygraph->title->SetFont(FF_TAHOMA, FS_BOLD, 15);
//กำหนดประเภทของฟ้อนต์ให้กับตัวหนังสือที่ใช้กับแกน Y
$mygraph->yaxis->title->SetFont(FF_TAHOMA, FS_BOLD, 10);
//กำหนดประเภทของฟ้อนต์ให้กับตัวหนังสือที่ใช้กับแกน X
$mygraph->xaxis->title->SetFont(FF_TAHOMA, FS_BOLD, 10);
$mygraph->xaxis->title->Set($x);
$mygraph->yaxis->title->Set($y);
$mygraph->xaxis->SetFont(FF_TAHOMA, FS_NORMAL, 10);
$mygraph->xaxis->SetTickLabels($xdata);****
//กำหนดให้รูปให้มีเงาอยู่ด้านหลัง
$mygraph->SetShadow();
//ปรับระยะห่างระหว่างขอบกราฟกับขอบรูปภาพ
$mygraph->SetMargin(50, 50, 40 , 60);
//กำหนดสีให้กับระยะห่างของขอบกราฟกับขอบรูปภาพ
$mygraph->SetMarginColor("greenyellow");
//กำหนดสีของแกน
$mygraph->xaxis->SetColor('blue');
$mygraph->yaxis->SetColor('blue','red');
//กำหนดความหนาของแกน
$mygraph->yaxis->SetWeight(2);
//กำหนดประเภทของฟ้อนต์ให้กับค่าต่างๆ ของแกน X
$mygraph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,10);
//ปรับตัวหนังสือที่บอกค่าต่างๆ ของแกน X ให้เอียง 90 องศา
$mygraph->xaxis->SetLabelAngle(90);
//ปรับระยะห่างระหว่างตัวหนังสือที่บอกค่าของแกน X กับแกน X
$mygraph->xaxis->SetLabelMargin(8);
//ปรับระยะห่างของชื่อแกน X กับ แกน X
$mygraph->xaxis->SetTitlemargin(15);
// กราฟแท่งที่หนึ่ง
$bplot1 = new BarPlot($ydata);
$bplot1->value->Show();
$bplot1->value->SetFormat('%d');
$bplot1->SetFillGradient("blue", "cyan", GRAD_MIDVER);
$bplot1->SetLegend($SetLegend);
//ข้อมูลและกราฟแท่งที่สอง
$ydata2 = array(30,91,68,77,38,13);
$bplot2 = new BarPlot($ydata2);
$bplot2->value->Show();
$bplot2->value->SetFormat('%d');
$bplot2->SetFillGradient('red', 'gold', GRAD_MIDVER);
$bplot2->SetLegend($SetLegend2);
// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($bplot1,$bplot2));
//เพิ่มแท่งกราฟเข้าไปในเฟรม
$mygraph->Add($gbplot);
//แสดงผลรูปกราฟ
$mygraph->Stroke($pic);
echo "<img src='$pic'>";
?>
ตรงข้อมูลใต้แกน x อะครับมะยอมเปงภาษาไทย
ต้องทำไงครับ
-
- Similar Topics
- ตอบกลับ
- แสดง
- โพสต์ล่าสุด
-
- 5 ตอบกลับ
- 2699 แสดง
-
โพสต์ล่าสุด โดย Jatuporn.k
08/07/2014 3:43 pm
ผู้ใช้งานขณะนี้
สมาชิกกำลังดูบอร์ดนี้: Google Adsense [Bot] และบุคลทั่วไป 121