Storing Tabular Data for a Graph in a Managed Bean

24-20 Web User Interface Developers Guide for Oracle Application Development Framework configuring special fill effects, see Section 24.8.2, Using Gradient Special Effects in Graphs.

24.6.1 Changing the Color, Style, and Display of Graph Data Values

For most graph types, an entry appears in the legend for each set of data values represented as graph bars, lines, areas, points, and slices. This entry identifies a set of related data values and displays the color that represents the set in the graph. For example, a bar graph might use yellow bars to represent the sales of shoes and green bars to represent the sales of boots. The graph component refers to each set of related data values as a series. The graph automatically assigns a different color to each set of data values. You can customize the colors assigned to each series, including the fill color and the border color. For some graph types, you can enable filtering the display of data values in a graph by hiding or showing the series from the graph legend. You can specify additional characteristics for specific graph types such as the width and style of lines in a line graph with choices including solid lines, dotted lines, lines with dashes, and so on. For more information, see Section 24.7.2, Changing the Appearance of Lines in Graphs. For scatter graphs you can separate data marker shape and color from the series to display the interdependence of data values. For more information, see Section 24.7.4, Customizing Scatter Graph Series Markers. You can also customize the colors of each series in a graph by adding gradient special effects. For more information, see Section 24.8.2, Using Gradient Special Effects in Graphs.

24.6.1.1 How to Specify the Color and Style for Individual Series Items

Use one dvt:seriesSet tag to wrap all the individual dvt:series tags for a graph and set attributes for color and style of graph data markers. To specify the color and style for series items in a graph: 1. In the Structure window, right-click the dvt:seriesSet child tag in the graph node, and choose Go to Properties. 2. Optionally, use the Property Inspector to specify values for attributes of the dvt:seriesSet tag. The attributes of this tag determine default settings for all series tags in the set. However, you can override these settings for a given series by entering values in the corresponding attributes of a dvt:series tag.

3. In the Structure window, right-click the seriesSet node and choose Insert inside

dvt:seriesSet Series. The first dvt:series tag represents the first series item that appears in the Create Graph Binding dialog. 4. Use the Property Inspector to specify colors and other characteristics as needed for the dvt:series tag. 5. Repeat Step 3 and Step 4 for each series item. Using ADF Graph Components 24-21

24.6.1.2 How to Control the Number of Different Colors Used for Series Items

The graph stores separate properties such as color for a specific number of series. Beyond that number, the graph repeats series properties. By default, a graph allows up to 30 different series items for which it displays separate properties. The value in the seriesObjectCount attribute of the graph determines the number of series before properties are repeated. If seriesObjectCount is set to the value 4, then series 5 has the same properties as series 1, series 6 has the same properties as series 2, and so on. To control the number of different colors used for series items: 1. In the Structure window, right-click the graph node and choose Go to Properties. 2. In the Property Inspector, in the Appearance attributes category, specify a zero-based value for the seriesObjectCount attribute of the graph.

24.6.1.3 How to Enable Hiding and Showing Series Items

For graph types including area, bar, bubble, combination, line, pie, radar, and scatter, you can enable the hiding or showing of the series in a graph at runtime. Although at least one series must be displayed in the graph, users can filter the display of data values by clicking on the corresponding legend item. To enable hiding and show series items: 1. In the Structure window, right-click the graph node and choose Go to Properties. 2. In the Property Inspector, in the Series section of the Appearance attributes category, set the hideAndShowBehavior attribute of the graph. Valid values include: ■ none: Default value, no hide and show series behavior is enabled. ■ withRescale: Rescales the graph to show only the visible series. ■ withoutRescale: Hides the series, but does not rescale the graph.

24.6.2 Formatting Data Values in Graphs

The attributes in a data collection can be data values or categories of data values. Data values are numbers represented by markers, like bar height, or points in a scatter graph. Categories of data values are members represented as an ordinal axis label, or appear as additional properties in a tooltip. You can format both numerical and categorical attributes by using ADF Faces converter tags, including af:convertNumber for numerical data values, and af:convertNumber, af:convertDateTime, and af:convertColor for categorical data values. Converter tag attributes let you format percents, scale numbers, control the number of decimal places, placement of signs, and so on. For more information about ADF Faces converters, see Chapter 6, Validating and Converting Input.

24.6.2.1 How to Format Categorical Data Values

Categorical data values in graphs are represented by the name in the page definition file pagenamePageDef.xml that defines the graph’s data model. Example 24–4 shows the XML code in a page definition file for a page with a graph displaying categorical data values for the hire date and the bonus cost for employees.