Jim Lawrence
accessd at shaw.ca
Sat Sep 11 21:27:42 CDT 2010
Yeah, Stuart there are a lot of great pieces of code available but 6 or 7 years ago good chart code was in slim supply. There is some incredible stuff out there, now... ;-) ...but keep the list coming. Jim -----Original Message----- From: dba-tech-bounces at databaseadvisors.com [mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Saturday, September 11, 2010 3:59 PM To: Discussion of Hardware and Software issues Subject: Re: [dba-Tech] So how do you automate imaging? And it turns out there are lots of scripts/classes out there which take much of the work out of it. http://www.google.com/search?q=php+gd+charting+library (About 44,700 results ) Some interesting links: pChart http://pchart.sourceforge.net/ libChart http://naku.dohcrew.com/libchart/pages/introduction/ and lots more commercial and free one here: http://www.hotscripts.com/category/php/scripts-programs/graphs-charts/ -- Stuart On 11 Sep 2010 at 9:54, Jim Lawrence wrote: > Hi Stuart: > > That's awesome. > > You would not believe how many lines of JavaScript code I have used to > create graphs for clients. This could make the job almost pleasant. > :-) > > Jim > > > > -----Original Message----- > From: dba-tech-bounces at databaseadvisors.com > [mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Friday, September 10, 2010 9:32 PM To: Discussion of > Hardware and Software issues Subject: Re: [dba-Tech] So how do you > automate imaging? > > On 11 Sep 2010 at 14:06, Stuart McLachlan wrote: > > > A quick look at http://www.php.net/manual/en/ref.image.php shows > > that it doesn't just manipulate existing images, it lets you create > > images with text, line, arc etc functions so you could use it to > > create graphs/charts on the fly in your web page from various data > > sources. > > > > Just tried one of the examples, it's really neat. > > The entire contents of the file > http://www.lexacorp.com.pg/imagetest.php follows, take a look at the > result. > > -- > Stuart > > > <?php > // create image > $image = imagecreatetruecolor(100, 100); > // allocate some colors > $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); > $gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0); > $darkgray = imagecolorallocate($image, 0x90, 0x90, 0x90); > $navy = imagecolorallocate($image, 0x00, 0x00, 0x80); > $darknavy = imagecolorallocate($image, 0x00, 0x00, 0x50); > $red = imagecolorallocate($image, 0xFF, 0x00, 0x00); > $darkred = imagecolorallocate($image, 0x90, 0x00, 0x00); > // make the 3D effect > for ($i = 60; $i > 50; $i--) { > imagefilledarc($image, 50, $i, 100, 50, 0, 45, $darknavy, > IMG_ARC_PIE); imagefilledarc($image, 50, $i, 100, 50, 45, 75 , > $darkgray, IMG_ARC_PIE); imagefilledarc($image, 50, $i, 100, 50, > 75, 360 , $darkred, IMG_ARC_PIE); > } > imagefilledarc($image, 50, 50, 100, 50, 0, 45, $navy, IMG_ARC_PIE); > imagefilledarc($image, 50, 50, 100, 50, 45, 75 , $gray, IMG_ARC_PIE); > imagefilledarc($image, 50, 50, 100, 50, 75, 360 , $red, IMG_ARC_PIE); > // flush image header('Content-type: image/png'); imagepng($image); > imagedestroy($image); ?> > > > > _______________________________________________ > dba-Tech mailing list > dba-Tech at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-tech > Website: http://www.databaseadvisors.com > > _______________________________________________ > dba-Tech mailing list > dba-Tech at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-tech > Website: http://www.databaseadvisors.com > _______________________________________________ dba-Tech mailing list dba-Tech at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-tech Website: http://www.databaseadvisors.com