Apache::Wyrd::Chart - Embed Dynamically-redrawn charts in HTML
<BASENAME::Chart img="chart.png" type="bars" height="200" width="300"> <BASENAME::Query> select month, price from monthly_prices order by month </BASENAME::Query> </BASENAME::Chart>
Chart-graphic Wyrd wrapping the
GD::Graph Module. Creates a graphic file (PNG) and a meta-data file based on data handed it to by an
The Chart Wyrd accepts nearly all the attributes of the GD::Graph module and the <img> tag, producing an <img> tag which points to the graphic file produced by GD::Graph, having most attributes (such as onClick, border, but not src) given to the Chart Wyrd.
Which column of the query to plot. Default: 2.
A comma or whitespace-separated list of label names. If not enough labels are given, the remainder will be labeled "unknown"
Which column of the query to use for labels. Default: 1.
Items with values under this number will be lumped together under the item name "Other".
A whitespace or comma delineated list of builtin filters to apply to the labels or values respectively. Current filters:
See GD::Graph documentation for more details. Files are always document-root-relative. Colors may be in GD::Graph name format or in in HTML "#XXXXXX" format. Edge-positions are in the GD::Graph standard of UL for Upper-Left, LL for Lower-Left, etc. 1 is the usual value for "yes" in boolean attributes. Lists are in a whitespace-separated or comma-separated list of items (using Apache::Wyrd::Services::SAK::token_parse). Angles are in degrees.
What type of graph, per the GD::Graph subclasses. Valid types are: lines, hbars, bars, points, linespoints, area, or pie
Colors for the respective chart elements
Data element and border colors, in list format.
Whether (1=yes) to show values, whether vertically, what space (pixels) around them and what (sprintf-style) format to display them in.
logo file, corner for logo, and resize factor
Legend attributes (axestype graphs only)
Axis attributes (for applicable chart types)
Bar-chart attributes, foo_clrs are lists. Cumulate is boolean, and means to stack values within a bar
Line-chart attributes. Line types are 1: solid, 2: dashed, 3: dotted, 4: dot-dashed. skip_undef leaves a gap for an undefined point
Marker types (1: filled square, 2: open square, 3: horizontal cross, 4: diagonal cross, 5: filled diamond, 6: open diamond, 7: filled circle, 8: open circle, 9: horizontal line, 10: vertical line) and size (in pixels)
Pie chart attributes. suppress_angle is a limit below which no line is drawn
Fonts. Either a file (if your system supports TTF) or one of the builtin fonts: gdTinyFont gdSmallFont gdMediumBoldFont gdLargeFont gdGiantFont
(format: (returns) name (arguments after self))
"Hook" method for putting final changes on the plotted GD graphic. Accepts the graphic as a GD object. Does nothing by default.
"Hook" method for putting final changes on the GD::Graph object. Accepts the chart as a GD::Graph object. Does nothing by default.
"Hook" method for setting default attributes. Does nothing by default.
"Hook" for filtering data/labels. Should accept a value for the filter and the data to perform filters upon.
Reserves the register_filter, _setup and _format_output methods. Also reserves the methods _set_default_attributes, _get_data, _process_data, _filter_labels, _filter_values, _filter. Also reserves the standard register_query method.
Produces, by default, a second file (<graphic_name>.tdf) in the same directory as the graphic which has the HTML fingerprint and the data stored in tab-delineated-text format.
Barry King <email@example.com>
General-purpose HTML-embeddable perl object
Copyright 2002-2007 Wyrdwright, Inc. and licensed under the GNU GPL.
See LICENSE under the documentation for