Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Line Graph Image Manipulation

by bkiahg (Pilgrim)
on Jun 25, 2008 at 21:06 UTC ( #694056=perlquestion: print w/ replies, xml ) Need Help??
bkiahg has asked for the wisdom of the Perl Monks concerning the following question:

Hello Wise Monks,

I once again come looking for a point in the right direction. What I'm trying to accomplish is taking an array of numbers and turning them into a line graph. I've looked into both GD and ImageMagick and always seem to get lost trying to get either installed on the windows server I'm working on. Here are some examples of what I'm doing:

my @array = ('98','95','83','75','98','95','83','75','98','95','83','75'); # Etc.

into Image to be produced.


The 2 questions I have are:

1. Which one (GD or ImageMagick) would be best suited to handle this type of application? And...

2. Where should I look to find some help installing and implementing this on a Windows 2003 server?

Thank you very much in advance.

Update: Heres a link to GD for windows in case anyone else stumbles across this looking for help. http://gnuwin32.sourceforge.net/packages/gd.htm

Comment on Line Graph Image Manipulation
Download Code
Re: Line Graph Image Manipulation
by moritz (Cardinal) on Jun 25, 2008 at 21:16 UTC
    I wouldn't use GD or ImageMagick directly, but rather a higher level module like GD::Graph, Lab::Data::Plotter or Chart. I've only used GD::Graph directly (and Gnuplot manually without the Lab::Data::Plotter interface), and found that it's not hard to use, but the quality of the output isn't as high as with gnuplot or (xm)grace.

    You can also search on cpan for plot, chart or graph.

    As to installing the modules, try the Super Search on this site, search for windows and module or something, there are dozens of threads about installing modules.

Re: Line Graph Image Manipulation
by pc88mxer (Vicar) on Jun 25, 2008 at 21:28 UTC
    I would also look into the myriad of plotting libraries available for Javascript. Some that come to mind are: Flot, and Processing.js.
Re: Line Graph Image Manipulation
by NetWallah (Abbot) on Jun 25, 2008 at 22:12 UTC
    From the graph image you linked, it appears that you are graphing time-series information.

    Depending on your problem domain and end-user requirements, you may want to consider comprehensive and automatic tools for gathering, managing and displaying information that is typically time-series based.

    The tools I'd recommend are based on rrdtool, which handles the database and graphing. Just this tool will probably meet requirements stated in your post. Web display and automation is achieved with MRTG as a starting point - when you are comfortable with that, upgrade to CACTI. These are typically used for network monitoring, but have applications in may other fields, such as temperature, and surf monitoring.

    One thing to note is that these tools automatically manage data such that older data is displayed with less resolution. This helps keep the total database size constant. If this is acceptable, these tools will most likely meet your needs, and resolve issues you didn't know you had.

         Have you been high today? I see the nuns are gay! My brother yelled to me...I love you inside Ed - Benny Lava, by Buffalax

Re: Line Graph Image Manipulation
by samtregar (Abbot) on Jun 25, 2008 at 22:50 UTC
    If this was my job, I'd use Google Charts. Hands down the easiest graphing I've ever done, and I've used all the ones mentioned in this thread. Prettier too, with the possible exception of RRDTool, which is very pretty but has a learning curve roughly akin to procmail.

    -sam

Re: Line Graph Image Manipulation
by Your Mother (Canon) on Jun 25, 2008 at 23:51 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://694056]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2014-07-25 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (170 votes), past polls