/* * _survey 得到一个投票的圆饼图 * @access public 表示函数对外公开 * @param $_agree 同意票数 * @param $_disagree 反对票数 * return 一张统计圆饼图 * */ function _vote($_agree,$_disagree){ //处理参数 if($_agree==0&&$_disagree==0){ $_vote = 270; } if($_agree==0&&$_disagree!=0){ $_vote = 91; } if($_agree!=0&&$_disagree==0){ $_vote = 89; } if($_agree!=0&&$_disagree!=0){ $_vote = intval(360*($_agree/($_agree+$_disagree))+90); } //创建画布 $_img=imagecreatetruecolor(150,100); //填充透明背景 imagealphablending($_img, false); imagesavealpha($_img, true); $white = imagecolorallocatealpha($_img,255,255,255,127); imagefill($_img,0,0,$white); //创建颜色 $_green=imagecolorallocate($_img,180,210,52); $_blue=imagecolorallocate($_img,83,201,237); $_gary=imagecolorallocate($_img,192,192,192); $_green1=imagecolorallocate($_img,149,178,36); $_blue1=imagecolorallocate($_img,41,160,193); $_gary1=imagecolorallocate($_img,144,144,144); for($i=60;$i>=50;$i--){ imagefilledarc($_img,100,$i,100,50,90,$_vote,$_blue1,IMG_ARC_PIE); imagefilledarc($_img,100,$i,100,50,$_vote,90,$_green1,IMG_ARC_PIE); } imagefilledarc($_img,100,$i,100,50,90,$_vote,$_blue,IMG_ARC_PIE); imagefilledarc($_img,100,$i,100,50,$_vote,90,$_green,IMG_ARC_PIE); header("content-type: image/png"); imagepng($_img); imagedestroy($_img); }
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章
Windows 11 KB5054979中的新功能以及如何解決更新問題
3 週前ByDDD
如何修復KB5055523無法在Windows 11中安裝?
2 週前ByDDD
Inzoi:如何申請學校和大學
4 週前ByDDD
如何修復KB5055518無法在Windows 10中安裝?
2 週前ByDDD
Roblox:Dead Rails - 如何召喚和擊敗Nikola Tesla
1 個月前By尊渡假赌尊渡假赌尊渡假赌

熱工具

Safe Exam Browser
Safe Exam Browser是一個安全的瀏覽器環境,安全地進行線上考試。該軟體將任何電腦變成一個安全的工作站。它控制對任何實用工具的訪問,並防止學生使用未經授權的資源。

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能

SublimeText3 Linux新版
SublimeText3 Linux最新版

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

PhpStorm Mac 版本
最新(2018.2.1 )專業的PHP整合開發工具