UIComponent class: oracle.adf.view.faces.bi.component.gauge.UIGauge
Component type: oracle.dss.adf.gauge.Gauge
Use the gauge tag to create an ADF gauge. The attributes on this tag are sufficient to produce a gauge but you can also specify custom settings for many components by including any of the gauge child tags.
The Gauge is a measuring instrument for indicating a quantity such as temperature, pressure, speed etc. It shows a metric value and threshold ranges using graphical representation. Inside a Gauge, there is an Indicator. The Indicator represents the metric value of the Gauge. A single Gauge shows a single metric value. If a grid of values is applied to the Gauge, the Gauge becomes a Gauge set that contains multiple Gauges and each of them represents a value in the grid.
There are four types of Gauges: Dial Gauge, Status Meter, Vertical Status Meter and LED Gauge. All Gauges consist of five major parts: Top Label, Bottom Label, Metric Label, Plot Area and Legend Area with an exception that LED Gauge does not have a Plot Area. Some other parts of the Gauge like Indicator, Tick Labels, Tick Mark and Gauge Frame may be inside the Plot Area as well.
Single Value - The simplest data model for a Gauge is a single metric value, which can be specified by the value attribute. In addition, the threshold, minimum and maximum values can also be specified by Threshold tag, and the minValue and maxValue attributes respectively. The following JSPX xml generates a single Gauge.
<dvt:gauge value = "10" minValue = "0" maxValue = "100"> <dvt:thresholdSet> <dvt:threshold thresholdMaxValue = "30"/> <dvt:threshold thresholdMaxValue = "60"/> <dvt:threshold/> </dvt:thresholdSet> </dvt:gauge>
Data Grid - Alternatively, the data binding dialogs can be used to bind the Gauge to a data control, which is typically based on a rowset. Another common way to provide data for the Gauge is to use the tabularData attribute to create a grid of data. This requires use of a backing or managed bean.
If a grid of values is specified, the Gauge becomes a Gauge set. Each Gauge in the Gauge set represents a value in the grid. The number of Gauges depends on the number of rows and columns in the grid by default. Users may customize the number of column in the Gauge set by using gaugeSetColumnCount attribute.
Data Specification - A Data Specification can be used to specify columns or rows of data to be used as the metric value, and threshold, minimum and maximum values. The following example shows how to use a Data Specification for a set of tabular data. This tabular data contains 5 columns and 2 rows. If Data Specification is not used, the following table will generate 10 Gauges that there will be a gauge for each value. Each column has its desired data specification as shown. Sales is assigned to be metric value, Quota is assigned to be the first threshold, etc. This will generate 2 Gauges, one for Boston and one for Chicago, both with metric, minimum, maximum and threshold values specified.
Desired Spec. | Metric | Minimum | Maximum | Threshold 1 | Threshold 2 |
Name | Sales | Min | Inventory | Quota | Target |
Boston | 40 | 0 | 100 | 30 | 50 |
Chicago | 60 | 0 | 80 | 35 | 70 |
CommonGauge gauge = new CommonGauge();
Object[] specs = { DataSpecification.METRIC, DataSpecification.MINIMUM, DataSpecification.MAXIMUM, DataSpecification.THRESHOLD, DataSpecification.THRESHOLD };
String[] colLabels = new String[] { "Sales", "Min", "Max", "Quota", "Target" };
String[] rowLabels = new String[] { "Boston", "Chicago" };
double[][] values = new double[][] { {40, 60}, {0,0}, {100,80}, {30,35}, {50,70} };
List gaugeData = new ArrayList();
for (int c = 0; c < colLabels.length; c++) {
for (int r = 0; r < rowLabels.length; r++) {
gaugeData.add(new Object[] { colLabels[c], rowLabels[r], new Double(values[c][r]) });
}
}
gauge.setTabularData(specs, gaugeData);
The Plot Area contains a graphical representation of the metric value for the Gauge. Different gauge types have different plot areas. Indicator, Thresholds and Tick Marks are generally inside the Plot Area.
The Gauge Frame is a decorative frame that encloses the whole plot area on Dial Gauges. Users may choose the fill color and the border color of the Gauge Frame.
The Plot Area appears differently in different types of gauge.
The Dial Gauge Plot Area consists of a dial and a needle. It looks like a speedometer. The dial has tick marks showing the values at specific angles. Users may change the angular extent of the dial using the angleExtent attribute.
The Vertical Status Meter and Status Meter are meters with a rectangular indicator placed in a bounding box. It looks like a mercury barometer. The bounding box has tick marks showing the values at certain locations within the box.
The LED Gauge does not have a Plot Area. See the Indicator section below for details on LED Gauge.
The Indicator shows the metric value of the Gauge. There are three types of indicators for Dial Gauges: Line, Needle and Fill. Line and Needle are rotating pointers to show the metric value by pointing to certain angle on the dial. The Needle indicator is thicker than the Line indicator. Fill is a slice or section of the dial that fills from the minimum value up to the metric value. Users may specify the indicator fill color and border color.
In a Status Meter, the indicator is rectangular. Its length is proportional to the metric value. Use the <dvt:indicatorBar> tag to specify the fill color and border color of the indicator.
The LED Gauge indicates its value mainly by its color. It changes its color to match the threshold range into which the metric value falls. Therefore, one or more thresholds must be present for LED Gauges. Users may change the style of the LED by attribute ledStyle. The shape of the LED gauge can be changed to circular (LS_DOT), an arrow shape (LS_ARROW), triangular (LS_TRIANGLE), or customizable shape (LS_CUSTOM).
In order to make the customizable shape is functional, both ledStyleCallback attribute and its callback class have to be implemented. The callback class extends the LedStyleCallback class, which users need to implement the getLEDImage method to return the desired image for every threshold range. See the JavaDoc for the LedStyleCallback class for more information.
A Threshold represents a significant value range like quota, target or limit value etc. When the indicator falls into one of the threshold ranges, it means certain criteria have been met or not. Different threshold ranges in gauges may have different colors, which you may customize.
Specify the threshold ranges by using <dvt:thresholdSet> tag and <dvt:threshold> tag. The thresholdMaxValue attribute is used to indicate the breakpoint of the ranges. For examples, if thresholdMaxValue of two threshold tags are specified, there will be three threshold ranges, starting from minimum value to first thresholdMaxValue, first thresholdMaxValue to second thresholdMaxValue and second thresholdMaxValue to maximum value. The threshold ranges can also be specified through the data bindings.
A Gauge Legend can be added to show the colors, ranges and descriptions of the Thresholds.
The style of threshold representation can be changed for Dial Gauges. Threshold colors can fill the entire plot area, form a solid or segmented ring around the Plot Area.
Dial Gauges and Status Meters have Tick Marks and Tick Labels to show the incremental, minimum and maximum values for a specific rotational angle or a location on the Plot Area. Users may specify where the tick marks occur within a Gauge, such as increments, minimum, maximum, metric, threshold values etc. If increment is specified, user may decide the number of ticks to be displayed in a gauge. Tick Labels may show actual value or percentage value. The Tick Labels can be positioned inside or outside of the Plot Area.
There are three labels in a gauge: Top Label, Bottom Label and Metric Label.
The Top Label shows the title of the Gauge. It can be positioned above the Gauge or inside the Gauge. The data grid column label is the default Top Label in Gauge Sets.
The Bottom Label further describes the value. It can be positioned below the Gauge or inside the Gauge. The data grid row label is the default Bottom Label in Gauge Sets.
The Metric Label shows the numerical value of the metric. It can be positioned below or with the bottom label, or inside the Gauge. The Metric Label may show the percentage value instead of numerical value.
If top, bottom, and metric labels are placed inside a Gauge, they are positioned at the center horizontally. When two or more labels are placed inside the Gauge, they are ordered vertically (from top, bottom and then metric label) within the Gauge Plot Area.
The Upper Label Frame is a decorative frame that encloses the Top Label, and the Lower Label Frame is the one that encloses the Bottom and Metric Labels. The fill color and border color of those frames can be modified.
The Legend of the Gauge shows a description of the thresholds. It shows the color and the name or range of each threshold. It can be positioned above, below, or to the left or right of the Gauge Plot Area using the position attribute of the <dvt:gaugeLegendArea> tag.
Note: Only one legend exists in either a single Gauge or a Gauge Set. For a Gauge Set, the threshold ranges or values showing in the legend is according to the first Gauge in the Gauge Set. Therefore, the usage of different threshold ranges for Gauges in a Gauge Set is not recommended.
The Legend Title and texts can be customized by the <dvt:gaugeLegendTitle> tag and <dvt:gaugeLegendText> tag respectively.
The default Gauge size is 200 pixels tall by 200 pixels wide. The "inlineStyle" attribute can be used to change the size. Set inlineStyle = "width: 500px; height: 350px;", for instance, to change the Gauge size to 350 pixels tall by 500 pixels wide. The width and the height can also be specified in percent. Use percent for height only when the Gauge is added to an explicitly sized container or one that manages layout, otherwise gauge will behave differently for different browsers. Use the "dynamicResize" attribute to resize the Gauge based on its container size. Note that the specified size applies to the collection of all of the Gauges in a Gauge set, rather than to each individual Gauge.
Gauges support animation. Animate the gauge during initial rendering using the attribute "animationOnDisplay". The Gauge can also be animated when the data changes using the attribute "animationOnDataChange". Use the attribute "animationDuration" to specify the animation duration. Animation is not supported in Gauge Sets.
Tooltips are useful to display identification and or detail information of the metric value. While the indicator shows the ballpark value of the metric value, tooltip can be very useful to show the exact value.
The <dvt:gaugeFont> tag is used for font formatting. Text color, style, size, and font name can be specified using this tag. This tag is used as a child tag for any of the Gauge's text component tags. Text components for the gauge are topLabel, bottomLabel, metricLabel, gaugeLegendText, gaugeLegendTitle and tickLabel.
Use the shapeAttributes tag to specify interactivity on an individual Gauge set component. A backing or managed bean may be required to use certain functionality of this feature. Please look at <dvt:shapeAttributes> tag for more information.
Here is an example of the interactivity on indicator and metric label. Here is a Dial Gauge. The tooltip of the indicator and the metric label become "Indicator" and "MetricLabel" respectively. When the indicator is clicked, the window title becomes "Indicator is clicked".
<dvt:gauge gaugeType="DIAL"> <dvt:shapeAttributesSet> <dvt:shapeAttributes component="GAUGE_INDICATOR" alt="Indicator" onClick="document.title="Indicator is clicked";"/> <dvt:shapeAttributes component="GAUGE_METRICLABEL" alt="MetricLabel"/> </dvt:shapeAttributesSet> </dvt:gauge>
The gauge can have the following child tags:
The following example shows XML for a gauge tag.
<dvt:gauge id="foo2" value ="#{sampleGauge.gaugeDataModel}"
gaugeType="STATUSMETER" imageFormat="FLASH"
imageHeight="350" imageWidth="250"
gaugeSetAlignment="GSA_RIGHT" gaugeSetColumnCount="2"
gaugeSetDirection="GSD_ACROSS"
partialTriggers="gaugeTypes2" partialSubmit="true">
</dvt:gauge>
Type | Phases | Description |
---|---|---|
org.apache.myfaces.trinidad.event.AttributeChangeEvent | Invoke Application, Apply Request Values |
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing. |
Name | Type | Supports EL? | Description |
---|---|---|---|
angleExtent | int | Yes | Specifies the angular extent of the dial gauge. Valid value is:
|
animationDownColor | String | Yes | Specifies the color used to indicate that a data value has decreased. Enter values in RGB hexadecimal. Does not apply in this release. |
animationDuration | int | Yes | Specifies the animation duration in milliseconds. The default value is 1000. |
animationIndicators | String | Yes |
Specifies the type of data change indicators to show. Valid values are:
Does not apply in this release |
animationOnDataChange | String | Yes |
Specifies the type of data change animation to apply. Valid values are:
|
animationOnDisplay | String | Yes |
Specifies the type of initial rendering effect to apply. Valid values are:
|
animationUpColor | String | Yes | Specifies the color used to indicate that a data value has increased. Enter values in RGB hexadecimal. Does not apply in this release. |
attributeChangeListener | javax.el.MethodExpression | Only EL | a method reference to an attribute change listener. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing. |
binding | String | Only EL | Specifies a binding reference to store an instance of the component. This component must be of type UIGauge. For example, to store an instance of the gauge component from the SampleGauge class, use the following code: binding="#{sampleGaugeBean.gauge}" |
clickAction | String | Yes | Refers to a backing bean method that performs navigation processing for the graph and returns an outcome String. Or a static outcome String can be specified. The JSF NavigationHandler selects the page to display next by matching the outcome String against the navigation rules in the application configuration resource file. The application writes the Navigation rules. |
clickListener | String | Yes | Refers to a backing bean method that takes a ClickEvent as an argument. The method will be process when the gauge is clicked. |
contentDelivery | String | Yes |
Specifies whether data is fetched with page load or after page load. Valid values are:
|
customLayout | String | Yes |
Specifies custom layout information when the graph automatically places and sizes its components. Valid values are:
|
customShapesPath | String | Yes | Specifies the path to the Custom Shapes definition file. |
customizationId | String | Yes | This attribute is deprecated. The 'id' attribute should be used when applying persistent customizations. This attribute will be removed in the next release. |
drillingEnabled | boolean | Yes | Specifies whether drilling is enabled in a gauge. This attribute is always set to "false" because drilling is not yet supported in the gauge. |
dynamicResize | String | Yes |
Specifies whether to resize the component based on its container size. Valid values are:
|
flashDefaultFontLoading | String | Yes | Specifies whether default fonts are loaded in FLASH from the middle tier. Valid values are:
|
fontURLMap | java.util.Map | Yes | Provides a mapping of font names and font swf file URLs in the form of a java.util.Map object. This map should have the font names as the keys, and the font URLs as the values. |
gaugeSetAlignment | String | Yes | Determines where gauges appear within a gauge set. Valid values are as follows:
|
gaugeSetColumnCount | String | Yes | Specifies the number of columns to display in a gauge set. Valid values are:
|
gaugeSetDirection | String | Yes | Direction for processing the gauges in a gauge set. Valid values are:
|
gaugeType | String | Yes | Specifies the type of gauge. Valid values are:
|
graphicAntialiasing | boolean | Yes | Specifies whether or not antialiasing will be used to smooth outlines of graphic areas. Valid values are true (Default) or false. |
id | String | No | the identifier for the component. The identifier must follow a subset of the syntax allowed in HTML:
|
imageFormat | String | Yes | Format of graph image. Valid values are:
|
imageHeight | int | Yes | Use inlineStyle attribute to specify the image width and height instead. For examples: inlineStyle = "width:500px; height:350px;".
The default height is 200 pixels. |
imageSource | String | Yes | Specifies the URI for an image file that was generated by the application. For example, an application might have exported to PNG and stored the image on the server previously. This provides a base from which to load the image. |
imageWidth | int | Yes | Use inlineStyle attribute to specify the image width and height instead. For examples: inlineStyle = "width:500px; height:350px;".
The default width is 200 pixels. |
inlineStyle | String | Yes | Style of the outer element of the component |
ledStyle | String | Yes | Specifies the kind of LED gauge. Valid values are:
|
ledStyleCallback | oracle.dss.gauge.LEDStyleCallback | Yes | Specifies code that defines a custom LED style. Code for the callback is usually stored in a backing bean for the gauge. For example: ledStyleCallback="{sampleGauge.myStyleCallback}" |
maxValue | double | Yes | Specifies the greatest value on the gauge scale/axis. This will be calculated automatically if it is not specified. |
minValue | double | Yes | Specifies the lowest value on the gauge scale/axis. This will be calculated automatically if it is not specified. |
otherProperties | String | Yes | Specifies settings for other properties in the form on an XML string. For example, this attribute could be used to set SFX properties such as gradientDirection. |
partialSubmit | boolean | Yes | Specifies whether an action should be performed through a partial page submit. Valid values are "true" (Default) and "false". |
partialTriggers | String | Yes | Specifies the IDs of the components that should trigger a partial update. This component will listen on the trigger components. If one of the trigger components receives an event that will cause it to update in some way, this component will request to be updated too. |
renderImagemap | boolean | Yes | Specifies whether an image map (PNG) should be rendered. Valid values are "true" (Default) or "false". |
rendered | boolean | Yes | Specifies whether the component is rendered. |
shortDesc | String | Yes | Short description of the gauge. Useful in the screen reader mode. |
specularHighlight | String | Yes | Specifies whether the crescent shaped highlight is displayed for LS_DOT LED gauges. Valid values are: SH_ON - (Default) Display the crescent shaped highlight. SH_OFF - Do not display the crescent shaped highlight. |
styleClass | String | Yes | Sets a CSS style class to use for this component. Note that width and height should be set using the inlineStyle property. |
svgFontEmbedding | String | Yes | Note: SVG is only supported as a printing format, so this attribute should no longer be used. Indicates whether fonts should be embedded directly in the generated SVG. This attribute offers one way to avoid inconsistencies between fonts available on the middle tier and fonts available on the client. Valid values are:
|
tabularData | java.util.List | Yes | Provides a tabular data set to a gauge in the form of a java.util.List object. |
textAntialiasing | boolean | Yes | Specifies whether or not antialiasing will be used to smooth text characters. Valid values are true or false (Default). |
thresholdDialStyle | String | Yes | The style for threshold dial gauges. Valid values are:
|
value | String | Yes | The gauge data model, which must be an instance of DataModel. Alternatively this attribute can take a number (represented as either a Java.lang.Number object or a String) which will be set as the metric value. |
visualEffects | String | Yes |
Specifies the type or types of visualEffect to apply. Valid values are:
|