[請益] php圖片顯示中文
<?php
require_once("ChartDirector/lib/phpchartdir.php");
# The data for the line chart
@mysql_connect("localhost","junwi","33338888") or die("sorry");
$str = "SELECT c1.course_name,j1.grade
FROM joinclass j1
JOIN courses c1 ON j1.course_id = c1.course_id
WHERE c1.course_id LIKE '%w'
AND j1.stu_id =93101163" ;
$result = @mysql_db_query("sample",$str) or die("die");
$number = mysql_num_rows($result);
for ($i=1; $i<=$number; $i++) {
$fo = mysql_fetch_object($result);
$labels[]=$fo->course_name;
$ydata[]=$fo->grade;
}
# Create a XYChart object of size 300 x 280 pixels
$c = new XYChart(300, 280);
# Set the plotarea at (45, 30) and of size 200 x 200 pixels
$c->setPlotArea(45, 30, 200, 200);
# Add a title to the chart using 12 pts Arial Bold Italic font
$c->addTitle("Web Grade", "arialbi.ttf", 12);
# Add a title to the y axis
$c->yAxis->setTitle("Web point");
# Add a title to the x axis
$c->xAxis->setTitle("Course name");
# Add a blue (0x6666ff) 3D line chart layer using the give data
$lineLayerObj = $c->addLineLayer($ydata, 0x6666ff);
$lineLayerObj->set3D();
# Set the labels on the x axis.
$c->xAxis->setLabels($labels);
# output the chart
header("Content-type: image/png");
print($c->makeChart2(PNG));
?>
結果如下:
http://www.badongo.com/pic/2800813
想在X軸上把???(中文)的地方 顯示出來...不知道要改哪邊@@
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.170.65.181
推
01/29 08:20, , 1F
01/29 08:20, 1F
→
01/29 08:20, , 2F
01/29 08:20, 2F
→
01/29 08:21, , 3F
01/29 08:21, 3F
→
01/29 15:21, , 4F
01/29 15:21, 4F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章