How to Create a Gauge Using Tabular Data

25-12 Web User Interface Developers Guide for Oracle Application Development Framework dvt:thresholdSet tag and individual dvt:threshold tags to create static thresholds. If threshold values are supplied in both the data collection and in threshold tags, then the gauge honors the values in the threshold tags.

25.4.4.1 Adding Static Thresholds to Gauges

You can create an indefinite number of thresholds in a gauge. Each threshold is represented by a single dvt:threshold tag. One dvt:thresholdSet tag must wrap all the threshold tags. To add static thresholds to a gauge: 1. In the Structure window, right-click the gauge node and choose Insert inside dvt:gauge ADF Data Visualization Threshold Set. You do not need to specify values for attributes on the dvt:thresholdSet tag.

2. Right-click the dvt:thresholdSet node and choose Insert inside dvt:thresholdSet

threshold . 3. In the Property Inspector, enter values for the attributes that you want to customize for this threshold. You have the option of entering a specific fill color and border color for the section of the gauge related to the threshold. You can also identify the maximum value for the threshold and any text that you want to display in the legend to identify the threshold.

4. Repeat Step 2 and Step 3 to create each threshold in the gauge from the lowest

minimum value to the highest maximum value. You have the option of adding any number of thresholds to gauges. However, arrow and triangle LED gauges support thresholds only for the three directions to which they point.

25.4.5 How to Format Numeric Values in Gauges

For gauges, the dvt:metricLabel and dvt:tickLabel tags may require numeric formatting.

25.4.5.1 Formatting the Numeric Value in a Gauge Metric Label

The metric label tag has a numberType attribute that lets you specify whether you want to display the value itself or a percentage that the value represents. In some cases, this might be sufficient numeric formatting. You can also use the af:convertNumber tag to specify formatting for numeric values in the metric label. For example, the af:convertNumber tag lets you format data values as currency or display positive or negative signs. To format numbers in a gauge metric label: 1. In the Structure window, right-click the gauge node and choose Insert inside dvt:gauge ADF Data Visualization metricLabel. Note: For the final threshold, the maximum value of the gauge is used as the threshold maximum value regardless of any entry you make in the threshold tag for the final threshold. Using ADF Gauge Components 25-13 2. If you want to display the metric value as a percentage rather than as a value, then set the NumberType attribute of the dvt:metricLabel tag to NT_PERCENT. 3. If you want to specify additional formatting for the number in the metric label, do the following:

a. Right-click the metricLabel node and choose Insert inside dvt:metricLabel

Convert Number . b. In the Property Inspector, specify values in the attributes of the af:convertNumber tag to produce additional formatting. The procedure for formatting numbers in gauge tick labels is similar to that of formatting numbers in the metric label except that you insert the dvt:tickLabel tag as a child of the gauge.

25.4.6 What Happens When You Format the Numbers in a Gauge Metric Label

When you add a metric label and number formatting to a gauge, XML code is generated. Example 25–3 shows a sample of the XML code that is generated. Example 25–3 XML Code Generated When Formatting a Number in a Metric Label dvt:gauge dvt:metricLabel position=LP_BELOW_GAUGE numberType=NT_PERCENT af:convertNumber type=percent dvt:metricLabel dvt:gauge

25.4.7 What You May Need to Know About Automatic Scaling and Precision

In order to achieve a compact and clean display, gauges automatically determine the scale and precision of the values being displayed in metric labels and tick labels. For example, a value of 40,000 will be formatted as 40K, and 0.230546 will be displayed with 2 decimal points as 0.23. Automatic formatting still occurs when af:convertNumber is specified. Gauge tags that support af:convertNumber child tags have scaling and autoPrecision attributes that can be used to control the graphs automatic number formatting. By default, these attribute values are set to scaling=auto and autoPrecision=on. Fraction digit settings specified in af:convertNumber, such as minFractionDigits, maxFractionDigits, or pattern, are ignored unless autoPrecision is set to off.

25.4.8 How to Format Text in Gauges

You can format text in any of the following gauge tags that represent titles and labels in a gauge: ■ dvt:bottomLabel ■ dvt:gaugeMetricLabel Note: When the numberType attribute of metric or tick labels is set to percent NT_PERCENT, a child af:convertNumber tag, if used, will be automatically set to percent for its type attribute. When af:convertNumber is forced to percent, gauge clears the pattern attribute. This means that patterns are ignored when a gauge forces percent formatting.