.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Jifty::Plugin::Chart::Web 3pm" .TH Jifty::Plugin::Chart::Web 3pm "2009-03-09" "perl v5.12.4" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Jifty::Plugin::Chart::Web \- Base class to add to Jifty::Web's ISA .SH "DESCRIPTION" .IX Header "DESCRIPTION" When the Jifty::Plugin::Chart is loaded, this class is added as a base class for Jifty::Web to add the \*(L"chart\*(R" method to that class. .SH "METHODS" .IX Header "METHODS" .SS "chart" .IX Subsection "chart" .Vb 1 \& Jifty\->web\->out(Jifty\->web\->chart(%args)); .Ve .PP The arguments passed in \f(CW%args\fR may include: .IP "type" 4 .IX Item "type" This will be one of the following scalar values indicating the kind of chart. A given renderer may not support every type listed here. A renderer might support others in addition to these, but if it supports these it should use these names. .RS 4 .IP "points" 4 .IX Item "points" This is the default value. A scatter plot with each dataset represented using differnet dot styles. .IP "lines" 4 .IX Item "lines" A line plot with each dataset presented as separate line. .IP "bars" 4 .IX Item "bars" A bar chart with each dataset set side-by-side. .IP "stackedbars" 4 .IX Item "stackedbars" A bar chart with each dataset stacked on top of each other. .IP "pie" 4 .IX Item "pie" A pie chart with a single dataset representing the values for different pieces of the pie. .IP "horizontalbars" 4 .IX Item "horizontalbars" A bar chart turned sideways. .IP "area" 4 .IX Item "area" An area chart uses lines to represent each dataset, but the lines are stacked on top of each other with filled areas underneath. .RE .RS 4 .RE .IP "width" 4 .IX Item "width" This is the width the chart should take when rendered. This may be a number, indicating the width in pixels. It may also be any value that would be appropriate for the \f(CW\*(C`width\*(C'\fR \s-1CSS\s0 property. .Sp Defaults to \f(CW\*(C`undef\*(C'\fR, which indicates that the chart will take on whatever size the box it is in will be. See \*(L"\s-1CSS\s0 \s-1FOR\s0 \s-1CHARTS\s0\*(R". .IP "height" 4 .IX Item "height" This is the height the chart should take when rendered. This may be a number, indicating the height in pixels. It may also be any value that would be appropriate for the \f(CW\*(C`height\*(C'\fR \s-1CSS\s0 property. .Sp Defaults to \f(CW\*(C`undef\*(C'\fR, which indicates that the chart will take on whatever size the box it is in will be. See \*(L"\s-1CSS\s0 \s-1FOR\s0 \s-1CHARTS\s0\*(R". .IP "data" 4 .IX Item "data" An array of arrays containing the data. The first array in the parent array is a list of labels. Each following array is the set of data points matching each label in the first array. .Sp Defaults to no data (i.e., it must be given if anything useful is to happen). .IP "class" 4 .IX Item "class" This allows you to associated an additional class or classes to the element containing the chart. This can be a string containing on or more class names separated by spaces or an array of class names. .IP "renderer" 4 .IX Item "renderer" This allows you to use a different renderer than the one configured in \fIconfig.yml\fR. Give the renderer as a class name, which will be initialized for you. .IP "options" 4 .IX Item "options" This is a hash containing additional options to pass to the renderer and are renderer specific. This may include anything that is not otherwise set by one of the other options above. .PP Here's an example: .PP .Vb 12 \& <% Jifty\->web\->chart( \& type => \*(AqPie\*(Aq, \& width => \*(Aq100%\*(Aq, \& height => \*(Aq300px\*(Aq, \& data => sub { \& [ \& [ 2004, 2005, 2006, 2007 ], \& [ 26, 37, 12, 42 ] \& ]; \& }, \& class => \*(Aqvisualizeronimicon\*(Aq, \& ) %> .Ve .PP Be sure to output anything returned by the method (unless it returns undef). .SH "CSS FOR CHARTS" .IX Header "CSS FOR CHARTS" The chart \s-1API\s0 allows you to build the charts without explicit pixel widths and heights. In fact, you can not specify \f(CW\*(C`width\*(C'\fR and \f(CW\*(C`height\*(C'\fR and perform the styling in your regular \s-1CSS\s0 stylesheets by using the \*(L"chart\*(R" class associated with every chart or by using custom classes with the \f(CW\*(C`class\*(C'\fR argument. .PP See your renderer class documentation for further details. .SH "JAVASCRIPT FOR CHARTS" .IX Header "JAVASCRIPT FOR CHARTS" Charts typically require JavaScript to render properly. If the client does not have JavaScript available, the chart may not work or could look very bad. .PP If you are using one of the image based renderers like Jifty::Plugin::Chart::Renderer::Chart, it is recommended that you stick with pixel widths if you expect clients with limited or no JavaScript support. .SH "SEE ALSO" .IX Header "SEE ALSO" Jifty::Plugin::Chart, Jifty::Plugin::Chart::Renderer .SH "AUTHOR" .IX Header "AUTHOR" Andrew Sterling Hanenkamp \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2007 Boomer Consulting, Inc. .PP This is free software and may be modified and distributed under the same terms as Perl itself.