|
The GaugePlugin creates PNG graphic files displaying gauge information.
Inputs
|
|
< < |
type |
no, defaults to value defined in TYPE in Plugins.GaugePlugin |
describes the type of guage to be used "thbar" Color coded bar for scorecard "trend" Arrow up, right, down for positive, 0, negative values |
|
> > |
type |
no, defaults to value defined in TYPE in TWiki.GaugePlugin |
describes the type of guage to be used "thbar" Color coded bar for scorecard "trend" Arrow up, right, down for positive, 0, negative values |
|
|
name |
yes (no default) |
Name to uniquely identify the gauge either in gauge creation (creating and storing the graphics making up the gauge) or gauge referencing (accessing an already created gauge graphics) |
value |
yes if defining a new gauge no if referencing an already defined/created gauge |
type = thbar - Defines the value the gauge is to display type = trend - postive = arrow up, 0 = arrow right, negative = arrow down |
|
|
< < |
thbar_colors |
no, defaults to values define in THBAR_COLORS in Plugins.GaugePlugin |
Two colors per scale. The first color is the dark color used for actual values. The second color is for filling out the rest of the gauge color (i.e. using scale values of "12 35 57" , if a value is 7, then there would be 7 pixels of the first color and the remaining pixels (to the end of the gauge) would be the 2nd color. If a value of 37, there would be 37 pixels of the 3rd color (since 37 falls in the range of the 2nd scale) and the remaining pixels would be the 4th color)
Scale #1 uses 1st & 2nd colors Scale #2 uses 3rd and 4th colors Scale #3 uses 5th and 6th colors Scale #N uses the (N*2)-1 and (N*2) colors
If type = thrend, then the 1st color defines the color of the arrow |
thbar_scale |
no, defaults to values define in THBAR_SCALE in Plugins.GaugePlugin |
Defines the number and position of the thbar scales. For example a value of "12 35 57" denotes that there are three regions on the bar gauge. The 1st encompasses values of 1-12, the 2nd values 13-35, and the 3rd and last values of 36-57. |
thbar_height |
no, defaults to values define in THBAR_HEIGHT in Plugins.GaugePlugin |
Defines the heigth, in pixels, of the thbar gauge (width defined as the last value from thbar_scale ) and the heigth of the scale portion of the guage. For example, a value of "18 2" means that the value portion of the guage is 18 pixels in height and the scale portion of the guage is 2 pixels in height making the total graphic 18 + 2 + 1 = 21 pixels where the 1 is a 1 pixel high dividing line between the value portion and scale portion of the gauge |
trend_geometry |
no, defaults to values define in TREND_GEOMETRY in Plugins.GaugePlugin |
Defines the geometry (width height) of the trend arrow |
trend_color |
no, defaults to values define in TREND_COLOR in Plugins.GaugePlugin |
Defines the color of the trend arrow |
|
> > |
thbar_colors |
no, defaults to values define in THBAR_COLORS in TWiki.GaugePlugin |
Two colors per scale. The first color is the dark color used for actual values. The second color is for filling out the rest of the gauge color (i.e. using scale values of "12 35 57" , if a value is 7, then there would be 7 pixels of the first color and the remaining pixels (to the end of the gauge) would be the 2nd color. If a value of 37, there would be 37 pixels of the 3rd color (since 37 falls in the range of the 2nd scale) and the remaining pixels would be the 4th color)
Scale #1 uses 1st & 2nd colors Scale #2 uses 3rd and 4th colors Scale #3 uses 5th and 6th colors Scale #N uses the (N*2)-1 and (N*2) colors
If type = thrend, then the 1st color defines the color of the arrow |
thbar_scale |
no, defaults to values define in THBAR_SCALE in TWiki.GaugePlugin |
Defines the number and position of the thbar scales. For example a value of "12 35 57" denotes that there are three regions on the bar gauge. The 1st encompasses values of 1-12, the 2nd values 13-35, and the 3rd and last values of 36-57. |
thbar_height |
no, defaults to values define in THBAR_HEIGHT in TWiki.GaugePlugin |
Defines the heigth, in pixels, of the thbar gauge (width defined as the last value from thbar_scale ) and the heigth of the scale portion of the guage. For example, a value of "18 2" means that the value portion of the guage is 18 pixels in height and the scale portion of the guage is 2 pixels in height making the total graphic 18 + 2 + 1 = 21 pixels where the 1 is a 1 pixel high dividing line between the value portion and scale portion of the gauge |
trend_geometry |
no, defaults to values define in TREND_GEOMETRY in TWiki.GaugePlugin |
Defines the geometry (width height) of the trend arrow |
trend_color |
no, defaults to values define in TREND_COLOR in TWiki.GaugePlugin |
Defines the color of the trend arrow |
|
|
Output
- A PNG graphics file is created containing the gauge results. The file is placed in
/pub/Tait/TWikiWorkSpec/_GaugePlugin_<type>_<name>.png
- Value/string returned is the name of the file created
_GaugePlugin_<type>_<name>.png . Value suitable for inclusion in an <IMG> HTML tag
Error Handling
If the required arguments are not defined, then the name of a graphic file containing an error message is returned.
Sample usage
<IMG SRC="%PUBURLPATH%/%WEB%/%TOPIC%/
%GAUGE{name="C1_customer_satisfaction" type="thbar" value="47"}%" ALT="47"><IMG SRC=%PUBURLPATH%/%WEB%/%TOPIC%/
%GAUGE{name="C1_customer_satisfaction_trend" type="trend" value="1" trend_color="#0000FF"}%">
Later improvement:
- Hash value to enhance performance:
- Build hash value (checksum) of each gauge based on initial settings and attributes, and store hash value.
- Regenerate image only of hash value is different.
- Since there are so few gauge attributes you could use the actual gauge string (expanded with initial values) as the hash value
- Idea for hash value file name: _GaugePlugin_<type>_<name>.hash, alternatively generate one hash value file per TWiki topic.
- Create a AttachmentStorePlugin that does the attachment storage handling; offers an API for plugins to use.
|
|
The GaugePlugin creates PNG graphic files displaying gauge information.
Inputs
%GAUGE% variables |
Required |
Description |
type |
no, defaults to value defined in TYPE in Plugins.GaugePlugin |
describes the type of guage to be used "thbar" Color coded bar for scorecard "trend" Arrow up, right, down for positive, 0, negative values |
name |
yes (no default) |
Name to uniquely identify the gauge either in gauge creation (creating and storing the graphics making up the gauge) or gauge referencing (accessing an already created gauge graphics) |
value |
yes if defining a new gauge no if referencing an already defined/created gauge |
type = thbar - Defines the value the gauge is to display type = trend - postive = arrow up, 0 = arrow right, negative = arrow down |
|
|
< < |
colors |
no, defaults to values define in COLORS in Plugins.GaugePlugin |
Two colors per scale. The first color is the dark color used for actual values. The second color is for filling out the rest of the gauge color (i.e. using scale values of "12 35 57" , if a value is 7, then there would be 7 pixels of the first color and the remaining pixels (to the end of the gauge) would be the 2nd color. If a value of 37, there would be 37 pixels of the 3rd color (since 37 falls in the range of the 2nd scale) and the remaining pixels would be the 4th color)
Scale #1 uses 1st & 2nd colors Scale #2 uses 3rd and 4th colors Scale #3 uses 5th and 6th colors Scale #N uses the (N*2)-1 and (N*2) colors
If type = thrend, then the 1st color defines the color of the arrow |
|
> > |
thbar_colors |
no, defaults to values define in THBAR_COLORS in Plugins.GaugePlugin |
Two colors per scale. The first color is the dark color used for actual values. The second color is for filling out the rest of the gauge color (i.e. using scale values of "12 35 57" , if a value is 7, then there would be 7 pixels of the first color and the remaining pixels (to the end of the gauge) would be the 2nd color. If a value of 37, there would be 37 pixels of the 3rd color (since 37 falls in the range of the 2nd scale) and the remaining pixels would be the 4th color)
Scale #1 uses 1st & 2nd colors Scale #2 uses 3rd and 4th colors Scale #3 uses 5th and 6th colors Scale #N uses the (N*2)-1 and (N*2) colors
If type = thrend, then the 1st color defines the color of the arrow |
|
|
thbar_scale |
no, defaults to values define in THBAR_SCALE in Plugins.GaugePlugin |
Defines the number and position of the thbar scales. For example a value of "12 35 57" denotes that there are three regions on the bar gauge. The 1st encompasses values of 1-12, the 2nd values 13-35, and the 3rd and last values of 36-57. |
thbar_height |
no, defaults to values define in THBAR_HEIGHT in Plugins.GaugePlugin |
Defines the heigth, in pixels, of the thbar gauge (width defined as the last value from thbar_scale ) and the heigth of the scale portion of the guage. For example, a value of "18 2" means that the value portion of the guage is 18 pixels in height and the scale portion of the guage is 2 pixels in height making the total graphic 18 + 2 + 1 = 21 pixels where the 1 is a 1 pixel high dividing line between the value portion and scale portion of the gauge |
|
|
< < |
thrend_scale |
no, defaults to values define in THREND_SCALE in Plugins.GaugePlugin |
Defines the width, in pixels, of the thrend right pointing arrow |
thbar_height |
no, defaults to values define in THREND_HEIGHT in Plugins.GaugePlugin |
Defines the heigth, in pixels, of the thrend arrow |
|
> > |
trend_geometry |
no, defaults to values define in TREND_GEOMETRY in Plugins.GaugePlugin |
Defines the geometry (width height) of the trend arrow |
trend_color |
no, defaults to values define in TREND_COLOR in Plugins.GaugePlugin |
Defines the color of the trend arrow |
|
|
Output
- A PNG graphics file is created containing the gauge results. The file is placed in
/pub/Tait/TWikiWorkSpec/_GaugePlugin_<type>_<name>.png
- Value/string returned is the name of the file created
_GaugePlugin_<type>_<name>.png . Value suitable for inclusion in an <IMG> HTML tag
Error Handling
If the required arguments are not defined, then the name of a graphic file containing an error message is returned.
Sample usage
<IMG SRC="%PUBURLPATH%/%WEB%/%TOPIC%/
%GAUGE{name="C1_customer_satisfaction" type="thbar" value="47"}%" ALT="47"><IMG SRC=%PUBURLPATH%/%WEB%/%TOPIC%/ |
|
< < | %GAUGE{name="C1_customer_satisfaction_trend" type="thrend" value="1" colors="#0000FF"}%"> |
> > | %GAUGE{name="C1_customer_satisfaction_trend" type="trend" value="1" trend_color="#0000FF"}%"> |
| Later improvement:
- Hash value to enhance performance:
- Build hash value (checksum) of each gauge based on initial settings and attributes, and store hash value.
- Regenerate image only of hash value is different.
- Since there are so few gauge attributes you could use the actual gauge string (expanded with initial values) as the hash value
- Idea for hash value file name: _GaugePlugin_<type>_<name>.hash, alternatively generate one hash value file per TWiki topic.
- Create a AttachmentStorePlugin that does the attachment storage handling; offers an API for plugins to use.
|
|
The GaugePlugin creates PNG graphic files displaying gauge information.
Inputs
%GAUGE% variables |
Required |
Description |
type |
no, defaults to value defined in TYPE in Plugins.GaugePlugin |
describes the type of guage to be used "thbar" Color coded bar for scorecard "trend" Arrow up, right, down for positive, 0, negative values |
name |
yes (no default) |
Name to uniquely identify the gauge either in gauge creation (creating and storing the graphics making up the gauge) or gauge referencing (accessing an already created gauge graphics) |
|
|
< < |
value |
yes if defining a new gauge no if referencing an already defined/created gauge |
Defines the value the gauge is to display |
colors |
no, defaults to values define in COLORS in Plugins.GaugePlugin |
Two colors per scale. The first color is the dark color used for actual values. The second color is for filling out the rest of the gauge color (i.e. using the defaults above, if a value is 7, then there would be 7 pixels of the first color and the remaining would be the 2nd color. If a value of 37, there would be 37 pixels of the 3rd color and the remaining pixels would be the 4th color) |
|
> > |
value |
yes if defining a new gauge no if referencing an already defined/created gauge |
type = thbar - Defines the value the gauge is to display type = trend - postive = arrow up, 0 = arrow right, negative = arrow down |
colors |
no, defaults to values define in COLORS in Plugins.GaugePlugin |
Two colors per scale. The first color is the dark color used for actual values. The second color is for filling out the rest of the gauge color (i.e. using scale values of "12 35 57" , if a value is 7, then there would be 7 pixels of the first color and the remaining pixels (to the end of the gauge) would be the 2nd color. If a value of 37, there would be 37 pixels of the 3rd color (since 37 falls in the range of the 2nd scale) and the remaining pixels would be the 4th color)
Scale #1 uses 1st & 2nd colors Scale #2 uses 3rd and 4th colors Scale #3 uses 5th and 6th colors Scale #N uses the (N*2)-1 and (N*2) colors
If type = thrend, then the 1st color defines the color of the arrow |
|
|
thbar_scale |
no, defaults to values define in THBAR_SCALE in Plugins.GaugePlugin |
Defines the number and position of the thbar scales. For example a value of "12 35 57" denotes that there are three regions on the bar gauge. The 1st encompasses values of 1-12, the 2nd values 13-35, and the 3rd and last values of 36-57. |
thbar_height |
no, defaults to values define in THBAR_HEIGHT in Plugins.GaugePlugin |
Defines the heigth, in pixels, of the thbar gauge (width defined as the last value from thbar_scale ) and the heigth of the scale portion of the guage. For example, a value of "18 2" means that the value portion of the guage is 18 pixels in height and the scale portion of the guage is 2 pixels in height making the total graphic 18 + 2 + 1 = 21 pixels where the 1 is a 1 pixel high dividing line between the value portion and scale portion of the gauge |
|
|
> > |
thrend_scale |
no, defaults to values define in THREND_SCALE in Plugins.GaugePlugin |
Defines the width, in pixels, of the thrend right pointing arrow |
thbar_height |
no, defaults to values define in THREND_HEIGHT in Plugins.GaugePlugin |
Defines the heigth, in pixels, of the thrend arrow |
|
|
Output |
|
< < |
- PNG graphics file created in /pub/Tait/TWikiWorkSpec/_GaugePlugin__.png
- Value returned is the name of the file created
_GaugePlugin__.png . Value suitable for inclusion in an ^lt;IMG> HTML tag
|
> > |
- A PNG graphics file is created containing the gauge results. The file is placed in
/pub/Tait/TWikiWorkSpec/_GaugePlugin_<type>_<name>.png
- Value/string returned is the name of the file created
_GaugePlugin_<type>_<name>.png . Value suitable for inclusion in an <IMG> HTML tag
|
| |
|
> > | Error Handling |
| If the required arguments are not defined, then the name of a graphic file containing an error message is returned. |
|
< < |
Storing images:
- generate PNG images using GD library
- store in attachment directory of topic:
- Location: /pub/Tait/TWikiWorkSpec
|
> > | Sample usage
<IMG SRC="%PUBURLPATH%/%WEB%/%TOPIC%/
%GAUGE{name="C1_customer_satisfaction" type="thbar" value="47"}%" ALT="47"><IMG SRC=%PUBURLPATH%/%WEB%/%TOPIC%/
%GAUGE{name="C1_customer_satisfaction_trend" type="thrend" value="1" colors="#0000FF"}%">
Later improvement: |
|
< < |
-
- Generate Tait and/or TWikiWorkSpec dir if not exist
- Name: _GaugePlugin__.png
Error handling:
Later improvement: |
|
- Hash value to enhance performance:
|
|
< < |
-
- Build hash value (checksum) of each gauge based on
|
> > |
-
- Build hash value (checksum) of each gauge based on initial settings and attributes, and store hash value.
|
|
< < | initial settings and attributes, and store hash value. |
|
-
- Regenerate image only of hash value is different.
|
|
< < |
-
- Since there are so few gauge attributes you could use
|
> > |
-
- Since there are so few gauge attributes you could use the actual gauge string (expanded with initial values) as the hash value
|
|
< < | the actual gauge string (expanded with initial values)
as the hash value |
|
-
- Idea for hash value file name:
|
|
< < | _GaugePlugin__.hash, alternatively generate |
> > | _GaugePlugin_<type>_<name>.hash, alternatively generate one hash value file per TWiki topic. |
|
< < | one hash value file per TWiki topic. |
| |
|
< < | |
> > |
- Create a AttachmentStorePlugin that does the attachment storage handling; offers an API for plugins to use.
|
|
< < | storage handling; offers an API for plugins to use. |
| |

Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback