tcallahan has asked for the wisdom of the Perl Monks concerning the following question:

I’m new as a Perl programmer, Unix shell guy. I was asked to learn Perl due to a staffing shortage, I was able to create a CGI program that plots BAR and LINESPOINT graphs to an intranet screen. Although I have several nagging problem, my two major ones are: 1) It takes 10 seconds (more for larger analysis) to plot the Graph. I am plotting by assigning an array. 2) I need to find a way to manipulate how my Y-axis is posted. I want to plot my numeric values, but I want to show 23:23 below 00:01. (I plot job-ending times). Any help or leads for research will be appreciated. I’ve already been to www.perl.com Thanks

Replies are listed 'Best First'.
Re: Graphing
by Beatnik (Parson) on Apr 02, 2001 at 18:25 UTC
    try GD::Graph (at CPAN)

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.
Re: Graphing
by lachoy (Parson) on Apr 02, 2001 at 18:08 UTC

    If you haven't seen it yet, the relatively new DBD::Chart might be useful for you. You'll need a few extra modules to go along with it but it looks pretty nifty.

    Chris
    M-x auto-bs-mode

Re: Graphing
by stefan k (Curate) on Apr 02, 2001 at 18:38 UTC
    Hi,
    I guess you create PNG images. If it's so, it is possible that the long time is spent in the compression library that compresses the PNG image data. I encountered that problem once when I created many many images in gnuplot. You can look at that thread here. (And more of it took place in the comp.graph.apps.gnuplot newsgroup ;-)

    Maybe for you (as a beginner as you said) it would be wise to stick with the gnuplot program for the start. It is easy to learn/use and you can just open a pipe to it. A quick start: www.gnuplot.org

    Actually that is what I usually do; no matter if coding data-stuff in perl or algorithm-ism in C/C++

    Update:
    1. There is also a way to handle time-data in gnuplot which may come out usefull for your problem
    2. I'm not pointing you to any CPAN modules because I think, if you're new to the world of perl you may not want to install your own modules right now (but -of course- you will in -say- 6 months *grin*)

    Regards Stefan K

Re: Graphing
by suaveant (Parson) on Apr 02, 2001 at 18:33 UTC
    There is always GD::Graph which is simple to use and creates many kinds of graphs, the other option is to create the graph (at least the bar graph) in html with tables and images. This is pretty quick. Create a table, align the images to the side you want, and have the script set their size appropriately. LINESPOINT I think you'll have to do with something like GD::Graph, or at least GD, or Imlib2 (I have an updated perl module for that if you want). Probably you want GD::Graph... - Ant
Re: Graphing
by Coyote (Deacon) on Apr 02, 2001 at 19:41 UTC
    If you are graphing time based data, you might want to check out RRDtool. It's more than just a graphing package, but its an excellent package and it has perl bindings.

    ----
    Coyote