note 44451 added to function.imagefilledarc

From: Date: Fri, 06 Aug 2004 01:08:33 +0000
Subject: note 44451 added to function.imagefilledarc
Groups: php.notes 
Request: Send a blank email to php-notes+get-74097@lists.php.net to get a copy of this message
The examples given so far for drawing a 3D looking pie chart are extremely inefficient and can give a huge performance hit to scripts that draw a lot of pies and in particular those that do offline processing on disk, rather than send a single pie chart to the browser (either way this modification saves you a lot of CPU cycles). Modify the portion of the code that creates the 3D effect to only draw the outline (with IMG_ARC_NOFILL) of the pie layers below the top filled pie: // make the 3D effect (modified for the original example) for ($i = 60; $i >= 50; $i--) { imagefilledarc($image, 50, $i, 100, 50, 0, 45, $darknavy, IMG_ARC_NOFILL); imagefilledarc($image, 50, $i, 100, 50, 45, 75 , $darkgray, IMG_ARC_NOFILL); imagefilledarc($image, 50, $i, 100, 50, 75, 360 , $darkred, IMG_ARC_NOFILL); } Note the >= on the for loop, which fills in a gap that is created without the = ---- Manual Page -- http://www.php.net/manual/en/function.imagefilledarc.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44451 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44451&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44451&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#74097) next »