Pie charts have always wanted to publish something. Recently just put PhP4 in the Php_gd.dll, can't wait to do some graphics program play. See a lot of PHP to do pie chart examples, looked at is 2 dimensions, so want to do a 3-dimensional. After the efforts Pie3d finished, good things to share with you. But the younger brother is the PHP novice, the code may not be refined, hoped that everybody advises together to consummate this procedure. Remember to let me know (estorm@yeah.net)
Define ("Angle_step", 5);//define the angle step when drawing an elliptical arc
function Chx_getdarkcolor ($img, $CLR) {//$clr the corresponding dark color
$rgb =imagecolorsforindex ($img, $CLR);
return Array ($rgb ["Red"]/2, $rgb ["Green"]/2, $rgb ["Blue"]/2);
}
function chx_getexy ($a, $b, $d) {//$d point coordinates on the corresponding ellipse
$d =deg2rad ($d);
Return Array (round ($a *cos ($d)), round ($b *sin ($d)));
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.