I would (and have) go the route of CGI with either HTML::Template or TT, using GD::Graph to produce the graphs. You may even want to try CGI::Application in conjunction with a templating system.
because what wasn't happening, and therefore wasn't in the log, was also important
This should be able to be done in SQL as well, making the db do all the work. Mysql provides the ifnull(colname, 0) command, which I'm sure there is an equivalent to in sqlite.
Your graph can then be produced with something like:
# Your SQL here. while (my ($timestamp, $field1, $field2, $field3)=$sth->fetchrow_array +() { push @timeline, $timestamp; push @data1, $field1; push @data2, $field2; push @data3, $field3; }
To assemble the data into arrays for graphing, and:
my $graph = GD::Graph::mixed->new($x_size, $height); my @data=([@timeline],[@data1],[@data2],[@data3]); $graph->set( y_label => 'Your graph title', title => "$title", line_width =>2, line_types =>[1,1], skip_undef =>1, box_axis =>1, correct_width =>1, fgclr =>"black", legendclr =>"black", x_label_skip =>$x_skip ) or die $graph->error; $graph->set_text_clr('black'); $graph->set( 'y_number_format' => \&y_format ); $graph->set_title_font(GD::gdSmallFont,12); $graph->set( types => ['area', 'lines','lines'] ); $graph->set( dclrs => ['pink','blue','green'] ); $graph->set_legend('your legend1', 'your legend2', 'your legen +d 3'); $graph->set(y_max_value=>($y_max)); $graph->set(y_min_value=>(0.1)); } my $gd = $graph->plot(\@data) or die $graph->error; binmode STDOUT; print $gd->jpeg(100); }
to graph it. Wrap it all in a CGI where you can input the necessary values (start time, end time, what kind of data you want, etc. ).

In reply to Re: Generating graphs and tables for admins - templates, frameworks, files or what? by leighsharpe
in thread Generating graphs and tables for admins - templates, frameworks, files or what? by yaconsult

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.