Oracle Fusion Middleware Data Visualization Tools Tag Reference for Oracle ADF Faces 12c (12.2.1.2) E76719-01 |
dvt:gauge gauge gauge
UIComponent class: oracle.adf.view.faces.bi.component.gauge.UIGauge
Component type: oracle.dss.adf.gauge.Gauge
The gauge tag is deprecated. Use the dialGauge, ledGauge, ratingGauge, or statusMeterGauge tag instead.
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);
DVT gauge supports number formatting on its metricLabel and tickLabel. Users can customize the number formatting by adding <af:convertNumber> to the <dvt:metricLabel> and <dvt:tickLabel> tags. The following is an example of how to configure these tags:
<dvt:gauge value="#{binding.dataModel}"> <dvt:metricLabel> <af:convertNumber pattern="#{appPrefs.metricLabelPattern}" /> </dvt:metricLabel> </dvt:tickLabel> <af:convertNumber pattern="#{appPrefs.tickLabelPattern}" /> </dvt:tickLabel> </dvt:gauge>
Automatic Scaling and Precision
Gauge automatically determines the scale ( e.g. 4K ) and precision ( e.g. show 2 decimal points - 0.25 ) based on the values that are being displayed. This automatic formatting still occurs when <af:convertNumber> is specified. The gauge tags that support <af:convertNumber> child tags ( <dvt:metricLabel> and <dvt:tickLabel>) also have scaling and autoPrecision attributes that can be used to control graph's automatic number formatting. By default, scaling="auto" means gauge will auto-calculate the scale. For example, 40,000 will be formatted as "40K". By default, autoPrecision="on" means that graph will auto-calculate the precision of the number. For example, 0.230546 will be displayed as "0.23". If the autoPrecision is 'on' then all of the <af:convertNumber> fraction digit settings ( e.g. min/maxFractionDigits or pattern) are ignored.
Formatting Percent values
When number type is set to percent (valid value are NT_NUMBER and NT_PERCENT), the formatting engine will use the label format and will automatically force the convertNumber type to percent. When <af:convertNumber> is forced to percent, gauge clears <af:convertNumber> pattern, since the pattern will prevent type=percent if specified. This means that patterns are ignored when gauge forces percent formatting.
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.
Context menus can be defined by using any of the context menu facets that are defined on the gauge. Context Menus are currently only supported in Flash.
Due to technical limitations when using the Flash rendering format, the context menu contents are currently displayed using the Flash Player's context menu. This imposes several limitations defined by the Flash Player:
Additionally, since Flash's request for context menu items is a synchronous call, so a server request to evaluate EL is not possible when the context menu is invoked. To provide context menus that vary by selected object, the menus will be pre-fetched if the context menu popup uses contentDelivery="lazyUncached". For context menus that may vary by state, this means that any EL expressions within the menu definition will be called repeatedly at render time, with different selection and currency states. When using these context menus that are pre-fetched, the application must be aware of the following:
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"
inlineStyle = "width:350px; height:250px;"
gaugeSetAlignment="GSA_RIGHT" gaugeSetColumnCount="2"
gaugeSetDirection="GSD_ACROSS"
partialTriggers="gaugeTypes2" partialSubmit="true">
</dvt:gauge>
In attachment mode, the gauge will be displayed in HTML5 or PNG, depending on the browser being used. Limited client interactivity, such as tooltips, is available. The clickListener feature is not supported in attachment mode.
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 event might include the width of a column that supported client-side resizing. |
Name | Description |
---|---|
bodyContextMenu | popup component containing the context menu that will be shown on right click on any non-selectable object within the component. The af:popup must contain an af:menu to display the context menu. This facet supports only a single child component. |
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 | Default Value: 1000 Specifies the animation duration in milliseconds. The default value is 1000. |
animationIndicators | int | Yes | Valid Values: NONE, ALL Default Value: ALL Specifies the type of data change indicators to show. Valid values are:
Does not apply in this release |
animationOnDataChange | int | Yes | Valid Values: none, activeData, auto Default Value: activeData Specifies the type of data change animation to apply. Valid values are:
|
animationOnDisplay | int | Yes | Valid Values: none, auto Default Value: none 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 | The listener interface for receiving click events on the gauge components. Here is an example of clickListener implementation that displays a component name on a click action -
|
contentDelivery | String | Yes | Valid Values: whenAvailable, lazy, immediate Default Value: whenAvailable 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 | Default Value: false 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 | Valid Values: FIXED_SIZE, DYNAMIC_SIZE Default Value: FIXED_SIZE Specifies whether to resize the component based on its container size. Valid values are:
|
flashDefaultFontLoading | int | Yes | Default Value: FLASH_DEFAULT_FONT_LOADING_ALL 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 | int | Yes | Valid Values: GSA_NONE, GSA_CENTER, GSA_TOPLEFT, GSA_TOP, GSA_TOPRIGHT, GSA_RIGHT, GSA_BOTTOMRIGHT, GSA_BOTTOM, GSA_BOTTOMLEFT, GSA_LEFT Default Value: GSA_NONE Determines where gauges appear within a gauge set. Valid values are as follows:
|
gaugeSetColumnCount | int | Yes | Specifies the number of columns to display in a gauge set. Valid values are:
|
gaugeSetDirection | int | Yes | Valid Values: GSD_ACROSS, GSD_DOWN Default Value: GSD_ACROSS Direction for processing the gauges in a gauge set. Valid values are:
|
gaugeType | int | Yes | Valid Values: DIAL, STATUSMETER, VERTICALSTATUSMETER, LED Default Value: DIAL Specifies the type of gauge. Valid values are:
|
graphicAntialiasing | boolean | Yes | Default Value: true Specifies whether or not antialiasing will be used to smooth outlines of graphic areas. Valid values are true (Default) or false. |
id | String | No | Unique identifier of the component. |
imageFormat | int | Yes | Valid Values: HTML5, FLASH, PNG, PNG_STAMPED, AUTO This attribute is deprecated. Use the oracle.adf.view.rich.dvt.DEFAULT_IMAGE_FORMAT context parameter instead. The component will use the specified default if possible, falling back to alternate output formats as needed based on the client browser. |
imageHeight | int | Yes | Default Value: 200 This attribute is deprecated. 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 | Default Value: 200 This attribute is deprecated. 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 | int | Yes | Valid Values: LS_DOT, LS_ARROW, LS_RECTANGLE, LS_TRIANGLE, LS_CUSTOM Default Value: LS_DOT 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 | Default Value: 100 Specifies the greatest value on the gauge scale/axis. This will be calculated automatically if it is not specified. |
minValue | double | Yes | Default Value: 0 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 | Default Value: true 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 | Default Value: true Specifies whether an image map (PNG) should be rendered. Valid values are "true" (Default) or "false". |
rendered | boolean | Yes | Default Value: true Specifies whether the component is rendered. |
shortDesc | String | Yes | Short description of the gauge. Useful in the screen reader mode. |
specularHighlight | int | Yes | Valid Values: SH_ON, SH_OFF Default Value: SH_ON 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 | int | Yes | Valid Values: SVG_FONT_EMBEDDING_ALL, SVG_FONT_EMBEDDING_NONE Default Value: SVG_FONT_EMBEDDING_ALL 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 | Default Value: true Specifies whether or not antialiasing will be used to smooth text characters. Valid values are true or false (Default). |
thresholdDialStyle | int | Yes | Valid Values: TDS_PIE_FILL, TDS_RING_FILL, TDS_SEGMENTS Default Value: TDS_SEGMENTS 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 | int | Yes | Valid Values: NONE, AUTO Default Value: AUTO Specifies the type or types of visualEffect to apply. Valid values are:
|