How to Change the Type of the Gauge

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. 25-14 Web User Interface Developers Guide for Oracle Application Development Framework ■ dvt:gaugeLegendText ■ dvt:gaugeLegendTitle ■ dvt:tickLabel ■ dvt:topLabel The procedure for formatting text in gauge labels and titles is similar except that you insert the appropriate child tag that represents the gauge label or title. For example, you can use a dvt:gaugeFont child tag to a dvt:metricLabel tag to specify gauge metric label font size, color, and if the text should be bold or italic. To format text 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. 2. Right-click the metricLabel node and choose Insert inside dvt:metricLabel Font . 3. In the Property Inspector, specify values in the attributes of the dvt:gaugeFont tag to produce the desired formatting. When you format text in a gauge metric label using the gaugeFont tag, XML code is generated. Example 25–4 shows a sample of the XML code that is generated. Example 25–4 XML Code Generated When You Format Text in a Gauge Metric Label dvt:gauge dvt:metricLabel dvt:gaugeFont name=Tahoma size=11 color=3C3C3C bold=true dvt:metricLabel dvt:gauge

25.4.9 How to Specify an N-Degree Dial

You can specify a gauge that sweeps through angles other than the standard 220-degree arc in a dial gauge. Set the angleExtent attribute to specify the range of degrees in the gauge. For example, to create a 270 degree dial gauge, set the angleExtent attribute as follows: dvt:gauge angleExtent=270.

25.4.10 How to Customize Gauge Labels

You can control the positioning of gauge labels. You can also control the colors and borders of the gauge label frames.

25.4.10.1 Controlling the Position of Gauge Labels

You can specify whether you want labels to appear outside or inside a gauge by using the position attribute of the appropriate label tag. The following label tags are available as child tags of dvt:gauge: ■ dvt:bottomLabel ■ dvt:metricLabel ■ dvt:topLabel