edraw手冊
一、程式檔案:
二、參數說明:
三、html範例:
(一)長條圖:
<img src="/et/class/database/drawbar.php?&x_word=%E4%BA%BA&y_word=%E9%87%91%E9%A1%8D%28%E5%8D%83%E5%85%83%29&x_angle=-30&xu=30&yu=4&vu=1000&poly[0][0]=401351&poly[0][1]=%E4%B8%81%E5%BF%97%E4%BB%81&poly[1][0]=464878&poly[1][1]=%E7%99%BD%E6%86%B6%E8%98%AD">(二)折線圖:
<img src="/et/class/database/drawpoly.php?&x_word=%E6%97%A5%E6%9C%9F&y_word=%E9%87%91%E9%A1%8D%28%E5%8D%83%E5%85%83%29&x_angle=-30&xu=30&yu=6&vu=1000&poly[0][0]=8674&poly[0][1]=8%E6%9C%88&poly[1][0]=78179&poly[1][1]=9%E6%9C%88&poly[2][0]=52218&poly[2][1]=10%E6%9C%88&poly[3][0]=120680&poly[3][1]=11%E6%9C%88&poly[4][0]=64978&poly[4][1]=12%E6%9C%88&poly[5][0]=143244&poly[5][1]=1%E6%9C%88&poly[6][0]=58907&poly[6][1]=2%E6%9C%88&poly[7][0]=36559&poly[7][1]=3%E6%9C%88&poly[8][0]=41921&poly[8][1]=4%E6%9C%88&poly[9][0]=91332&poly[9][1]=5%E6%9C%88&poly[10][0]=40529&poly[10][1]=6%E6%9C%88&poly[11][0]=66375&poly[11][1]=7%E6%9C%88&poly[12][0]=39821&poly[12][1]=8%E6%9C%88&poly[13][0]=22812&poly[13][1]=9%E6%9C%88">(三)派圖:
<img src="/et/class/database/drawpie.php?&x_word=%E9%A0%85%E7%9B%AE&y_word=%E9%87%91%E9%A1%8D%28%E5%8D%83%E5%85%83%29&x_angle=0&xu=30&yu=6&vu=1000&poly[0][0]=164991&poly[0][1]=%E9%A3%9F&poly[1][0]=138862&poly[1][1]=%E4%BD%8F&poly[2][0]=115633&poly[2][1]=%E8%82%B2&poly[3][0]=107752&poly[3][1]=%E5%81%A5&poly[4][0]=82108&poly[4][1]=%E8%A1%8C&poly[5][0]=57910&poly[5][1]=%E7%A8%85&poly[6][0]=53747&poly[6][1]=%E6%A8%82&poly[7][0]=42190&poly[7][1]=%E9%A4%BD&poly[8][0]=38916&poly[8][1]=%E8%A1%A3&poly[9][0]=38600&poly[9][1]=%E9%80%9A&poly[10][0]=15520&poly[10][1]=%E8%B3%87&poly[11][0]=10000&poly[11][1]=%E5%85%AC">四、php範例:
$str="<image src=".edraw所在的位置."drawbar.php?"; $str.="&x_word=".urlencode($x_word)."&y_word=".urlencode($y_word)."&x_angle=".$x_angle."&xu=".$xu."&yu=".$yu."&vu=".$vu; $i=0; foreach($arr as $row){ $str.="&poly[".$i."][0]=".$row[0]; $str.="&poly[".$i."][1]=".urlencode($row[1]); $i++; } $str.=">"進階範例:nd.php,nd4paper.php,15-17.php
四、MySQL範例:
(一)二階:
$result=$this->query("select sum(欄1),欄2 from 表 group by 欄2 order by …"); $str="<image src=".edraw所在的位置."drawmultipoly.php?"; $str.="&x_word=".urlencode($sqls['x_word'])."&y_word=".urlencode($sqls['y_word'])."&x_angle=".$sqls['x_angle']."&xu=".$sqls['xu']."&yu=".$sqls['yu']."&vu=".$sqls['vu']; $i=0; while($row=mysql_fetch_row($result)){ $str.="&poly[".$i."][0]=".$row[0]; $str.="&poly[".$i."][1]=".urlencode($row[1]); $i++; } $str.=">";
(二)三階多重折線圖:
$result=$this->query("select sum(欄1),欄2,欄3 from 表 group by 欄2,欄3 order by …"); $str="<image src=".edraw所在的位置."drawmultipoly.php?"; $str.="&x_word=".urlencode($sqls['x_word'])."&y_word=".urlencode($sqls['y_word'])."&x_angle=".$sqls['x_angle']."&xu=".$sqls['xu']."&yu=".$sqls['yu']."&vu=".$sqls['vu']; $i=0; $row=mysql_fetch_row($result); $str.="&poly[0][0][".urlencode($row[2])."]=".$row[0]; $str.="&poly[0][1]=".urlencode($row[1]); $xCue=$row[1]; while($row=mysql_fetch_row($result)){ if($xCue!=$row[1]){ $i++; $str.="&poly[".$i."][1]=".urlencode($row[1]); $xCue=$row[1]; } $str.="&poly[".$i."][0][".urlencode($row[2])."]=".$row[0]; } $str.=">";