Log in

View Full Version : php (trim and join jpgs) : (plot data)



Strangeplant
01-31-2007, 02:46 PM
Hi All,

I have a load of time stamped collected data as jpgs. Is there a way to trim off the left and/or right sides of a set of jpgs and join them together in php so that the server can serve up a linear graph/chart composed of the selected data range?

The other way, I would have to determine which files are needed, append these files (tab delimited in ASCII), strip out unwanted text and html code, decode the time stamps, then select needed data lines, put only specific selected data columns into arrays from multiple files and find a way to plot this in various colors, then display. I suppose this is the most versatile approach, but the graphing is not something I know how to do either.....

Strangeplant
02-01-2007, 01:49 PM
I think I found my own answer this time. Found a free (at least for me) Object-Oriented Graph creating library for PHP >= 4.3.1 and a version for >= 5.1 called JpGraph at http://www.aditus.nu/jpgraph/index.php that apparently provides all the tools to generate almost any kind, size and quality of graph or plot from data (file, array, mysql db or excel db) that you could ever imagine. A simple plot of an array can be made with only six lines of code. The output is directed to the http page, file or pdf page, provided as jpg, or png.

An interesting note is that it will also make the anti-spam OCR characters for live user input check, such as at http://www.aditus.nu/jpgraph/features_gallery.php#AntiSpam Also includes a barcode generator, FWTW.

Anyway, I plan on trying this library out with my data, unless anyone knows of something better and easier. Has anyone used this library and can give me some feedback on the processing overhead for the php processor on the server? I don't want to crash the php part of my webserver.

Twey
02-01-2007, 02:05 PM
An interesting note is that it will also make the anti-spam OCR characters for live user input check, such as at http://www.aditus.nu/jpgraph/feature...y.php#AntiSpamHowever, judging by the demo, it doesn't go the full length required to make such things accessible. I'd avoid it if I were you.