Php draws a pie chart with a transparent background and starts to rotate to the bottom of the circle.
/** _ Survey get a voting pie chart * @ access public indicates that the function is made public * @ param $ _ agree agreed votes * @ param $ _ disagree opposed votes * return a statistical pie chart figure **/function _ vote ($ _ agree, $ _ disagree) {// processing parameter 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 );} // create a canvas $ _ img = imagecreatetruecolor (150,100); // fill in the transparent background imagealphablending ($ _ img, false); imagesavealpha ($ _ img, true ); $ white = imagecolorallocatealpha ($ _ img, 255,255,255,127); imagefill ($ _ img, 180,210, $ white); // create a color $ _ green = imagecolorallocate ($ _ img, 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, 50, 90, $ _ vote, $ _ blue1, IMG_ARC_PIE ); imagefilledarc ($ _ img, 100, $ I, 100, $ _ vote, 90, $ _ green1, IMG_ARC_PIE);} imagefilledarc ($ _ img, $ I, 50, 90, $ _ vote, $ _ blue, IMG_ARC_PIE); imagefilledarc ($ _ img, 100, $ I, $ _ vote, 90, $ _ green, IMG_ARC_PIE ); header ("content-type: image/png"); imagepng ($ _ img); imagedestroy ($ _ img );}