GaugePlugin
Build dashboards that contain graphical images of gauges defined with
%GAUGE%
macros.
Description
This plugin can be used to build dashboards that contain graphical images of gauges like
(target measure gauge) and
(trend icons).
Two types of gauges are currently available, a target measure bar and a trend icon.
Type of Gauge |
Name |
What it Does |
Example |
Target Measure Bar |
tambar |
Shows the actual state of a measure in a bar. The bar has two parts, the upper thick bar shows the actual value, the lower thin bar shows the scale of the gauge. For example regions with a relative distribution of bad (red), acceptable (yellow) and good (green) values |
|
Trend Icon |
trend |
Shows the up trend, no change and down trend of a measure |
, , |
The Target Measure Bar has scale regions (the lower thin bar) like red, yellow and green. Each region has a start and end boundary, the end boundary of one region is the start of the next. The scale determines the boundaries, e.g. a scale of
0, 10, 20, 40
has a red region with range
0...10
, a yellow one with range
10...20
and a green one with range
20...40
.
The upper value region (the thick bar) has two colors, a dark color used for actual value and a light color for filling out the rest of the gauge with a lighter color.
The
%GAUGE{...}%
variable gets expanded to an image representing the gauge. Parameters and global settings determine the type of gauge, dimensions, scale and values.
Plugin Settings
Plugin settings are stored as preferences values. You can override the defaults for these preferences in
SitePreferences, the
WebPreferences topic of the current web, or in individual topics that use the plugin.
Changing them here will have no effect! This allows you to upgrade the plugin without having to worry about losing your settings.
- Set DEBUG to 1 to get debug messages in the debug log file. Default:
0
- Set GAUGEPLUGIN_DEBUG = 0
- Default gauge used:
tambar
, trend
. Default: tambar
- Set GAUGEPLUGIN_TYPE = tambar
- Default dimensions, scale and colors for Target Measure Bar. See details in the syntax rules.
- Set GAUGEPLUGIN_TAMBAR_WIDTH = 60
- Set GAUGEPLUGIN_TAMBAR_HEIGHT = 16
- Set GAUGEPLUGIN_TAMBAR_SCALE = 0, 33, 67, 100
- Set GAUGEPLUGIN_TAMBAR_COLORS = #FF0000, #FFCCCC, #FFFF00, #FFFFCC, #00FF00, #CCFFCC
- Default dimensions for Trend Icon
- Set GAUGEPLUGIN_TREND_WIDTH = 16
- Set GAUGEPLUGIN_TREND_HEIGHT = 16
Syntax Rules
The
%GAUGE{...}%
variable gets expanded to an image representing the gauge.
%GAUGE% Parameter |
Comment |
Default |
type |
The type of gauge to be used, tambar or trend |
Global TYPE setting |
name |
Name to uniquely identify the gauge file that is auto-created. |
None; is required for tambar (not required for trend ) |
value |
For tambar : The actual value of the gauge For trend : Positive = arrow up, 0 = arrow right, negative = arrow down |
None. Show "no data" if missing |
alt |
Alternate text for image |
Value is value parameter |
width |
Defines the width of the gauge in pixels. |
Global <type>_WIDTH setting |
height |
Defines the height of the gauge in pixels. |
Global <type>_HEIGHT setting |
scale |
For tambar : Defines the number and position of the scales. For example a value of "5, 12, 35, 57" denotes that there are three regions on the bar gauge, "5...12" , "12...35" and "35...57" . For trend : N/A |
Global <type>_SCALE setting |
colors |
For tambar : List of colors, each region has two colors. For trend : N/A |
Global <type>_COLORS setting |
Examples
Type of gauge |
You type |
You should get... |
...if installed |
Target Measure Bar |
%GAUGE{ type="tambar" name="t1" scale="0, 10, 20, 40" value="27" }% |
|
%GAUGE{ type="tambar" name="t1" scale="0, 10, 20, 40" value="27" }% |
Trend Icon |
%GAUGE{ type="trend" name="t2" value="-3" }% |
|
%GAUGE{ type="trend" name="t2" value="-3" }% |
The "if installed" column shows images instead of variables in case the plugin is installed correctly.
More examples can be found at
GaugePluginTests.
Output
- A PNG graphics file is created containing the gauge results. The file is placed in
%PUBURLPATH%/%WEB%/%TOPIC%/_GaugePlugin_<type>_<name>.png
-
%GAUGE{...}%
gets expanded to an <img ... />
image tag.
Error Handling
If the required parameters are not defined, then an error message is returned or an <img ... /> image tag is returned pointing to a graphic containing the error message.
Installation Instructions
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available in
configure
, then you can still install manually from the command-line. See
http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Check
GaugePluginTests to verify the plugin is installed and working correctly.
Plugin Info
Related Topics: GaugePluginTests,
DefaultPreferences,
SitePreferences,
Plugins