README
1NAME
2 Catalyst::View::RRDGraph - RRD Graph View Class
3
4SYNOPSIS
5 use the helper to create your View myapp_create.pl view RRDGraph
6 RRDGraph
7
8 from the controller:
9
10 sub routine :Local {
11 my ($self, $c) = @_;
12
13 $c->stash->{'graph'} = [
14 "--lower-limit", "0",
15 "--start", "end-1d",
16 "--vertical-label", "My Label",
17 "--height", 600,
18 "--width", 300,
19 "DEF:Data=/path/to/rrd.rrd:data:AVERAGE",
20 "AREA:Data#0000FF:Data "
21 ];
22 $c->forward('MyApp::View::RRDGraph');
23 }
24
25DESCRIPTION
26 This view generates RRD graph images from the graph defintion placed in
27 the stash. The controller is responsable of placing an ARRAYREF in
28 $c-stash->{'graph'}> with the same data as to generate a graph with the
29 RRDs module, except for *filename*, that will be automatically generated
30 by the view.
31
32 It doesn't depend on RRDs, but *does* need it to work (and for the tests
33 to pass). You can install RRDs, for instance, using Alien::RRDtool, or
34 compiling it manually from <http://oss.oetiker.ch/rrdtool/>
35
36CONFIGURATION
37 Configurations for the view are:
38
39 IMG_DIR
40 Directory to generate temporary image files. Defaults to /tmp/
41
42 IMG_FORMAT
43 Image format for the generated files. 'PNG' by default.
44
45 ON_ERROR_SERVE
46 On error, if this config value is set, the file to which it points will
47 be served (so you can serve an "error image" file to the user).
48 Alternately, it can be set to a code reference, that will called with
49 $self, $c and $error. You can then generate your own content in this
50 handler. Default (leaving undefined) is to throw an expception.
51
52 See <http://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html> for more info.
53
54METHODS
55 new
56 Constructor.
57
58 process
59 Called internally by Catalyst when the view is used.
60
61AUTHOR
62 Jose Luis Martinez
63 CPAN ID: JLMARTIN
64 CAPSiDE
65 jlmartinez@capside.com
66 L<http://www.pplusdomain.net>
67
68THANKS
69 To Ton Voon for sending in patches, tests, and ideas.
70
71 Alexander Kabenin
72
73COPYRIGHT
74 This program is free software; you can redistribute it and/or modify it
75 under the same terms as Perl itself.
76
77 The full text of the license can be found in the LICENSE file included
78 with this module.
79
80SEE ALSO
81 RRDs: <http://oss.oetiker.ch/rrdtool/prog/RRDs.en.html>
82
83 RRD graph docs: <http://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html>,
84 <http://oss.oetiker.ch/rrdtool/doc/rrdgraph_data.en.html>,
85 <http://oss.oetiker.ch/rrdtool/doc/rrdgraph_graph.en.html>
86
87