How to Display Either Data Lines or Markers in Graphs

Using ADF Graph Components 24-41 a. In the Common attributes category, specify values for the index attribute of the reference object, the type attribute of the reference object RO_LINE or RO_AREA, the associated object in the association attribute a series for a reference line or a specific axis for a reference area. Also specify if the object should be displayed in the legend using the displayedInLegend attribute, and specify the text, if any, to display in the legend. b. If you are creating a reference line, then specify values for the attributes related to the line. This includes specifying the series number of the series to which the line is related. The series number refers to the sequence in which the series appear in the Graph data binding dialog. c. If you are creating a reference area, then specify the low value and the high value that represent the reference area on the specified axis.

5. In the Structure window, right-click the graph node and choose Go To Properties.

6. In the Property Inspector, select the Appearance attributes category and do the

following to control the display of reference lines and reference areas: a. If you have defined reference lines which must be related to a series, then expand the dvt:series node and specify a value for the behavior of the displaySeries attribute. The value RO_DISPLAY_AUTOMATIC enables the display of a reference line only when the cursor moves over a series item such as a bar or over the corresponding series entry in the graph legend. This choice prevents the confusion that might occur if multiple series reference lines were displayed all the time. b. If you have defined reference areas which must be related to specific axes, then associate the reference object with the appropriate axis or axes.

24.8.1.2 What Happens When You Create Reference Lines or Areas During Design

When you create reference lines or areas during design, XML code is generated within the graph XML on the JSF page. The reference objects both lines and areas are wrapped by the dvt:referenceObjectSet tags. Example 24–8 shows the code for three reference areas associated with the y1-axis, one reference area associated with the y2-axis, and four reference lines associated with different series. Example 24–8 XML Code for Reference Lines and Areas in a Graph dvt:barGraph value ={sampleGraph.graphDataModel} graphType=BAR_VERT_CLUST2Y imageFormat=FLASH dvt:referenceObjectSet displayX1=RO_DISPLAY_AUTOMATIC displayY2=RO_DISPLAY_AUTOMATIC dvt:referenceObject index=1 type=RO_AREA association=Y1AXIS location=RO_BACK color=55FF0000 lowValue=0 highValue=4000 displayedInLegend=true text=Low dvt:referenceObject index=2 type=RO_AREA association=Y1AXIS location=RO_BACK color=55FFFF00 lowValue=4000 highValue=10000 displayedInLegend=true text=Medium dvt:referenceObject index=3 type=RO_AREA association=Y1AXIS location=RO_BACK color=5500FF00 lowValue=10000 highValue=18000 displayedInLegend=true text=High dvt:referenceObject index=4 type=RO_AREA association=Y2AXIS location=RO_FRONT color=550000FF lowValue=300 highValue=700 dvt:referenceObject index=5 type=RO_LINE association=SERIES series=0 location=RO_FRONT color=ffff66 lineValue=5000 lineWidth=3 24-42 Web User Interface Developers Guide for Oracle Application Development Framework lineStyle=LS_SOLID dvt:referenceObject index=6 type=RO_LINE association=SERIES series=0 location=RO_FRONT color=ffff66 lineValue=16730 lineWidth=3 lineStyle=LS_SOLID dvt:referenceObject index=7 type=RO_LINE association=SERIES series=1 location=RO_BACK color=99cc66 lineValue=500 lineWidth=3 lineStyle=LS_SOLID dvt:referenceObject index=8 type=RO_LINE association=SERIES series=1 location=RO_BACK color=99cc66 lineValue=1711 lineWidth=3 lineStyle=LS_SOLID dvt:referenceObjectSet dvt:barGraph

24.8.1.3 How to Create Reference Lines or Areas Dynamically

If you want to create reference objects dynamically at runtime, then you use only the dvt:referenceObjectSet tag. You set the referenceObjectMap attribute on this tag with a method reference to the code that creates a map of the child component reference objects. The method that creates this map must be stored in a managed bean. To create reference lines or areas dynamically: 1. Write a method that creates a map of the child component reference objects that you want to create during runtime. Example 24–9 shows sample code for creating this method.

2. In the Structure window, right-click the graph node, then choose Insert inside

dvt:typeGraph ADF Data Visualization Reference Object Set. 3. In the Property Inspector, specify in the referenceObjectMap attribute a method reference to the code that creates the map of child component reference objects. For example, for the managed bean sampleGraph and the method getReferenceObjectMapList, the attribute should be set to the following value: referenceObjectMap={sampleGraph.referenceObjectMapList} Example 24–9 Code for a Map of Child Reference Objects Managed bean SampleGraph.java : public Map getReferenceObjectMapList { HashMap map = new HashMap; ReferenceObject referenceObject = new ReferenceObject; referenceObject.setIndex1; referenceObject.setColorColor.red; referenceObject.setLineValue30; referenceObject.setLineWidth3; map.putnew Integer1, referenceObject; return map; }

24.8.2 Using Gradient Special Effects in Graphs

A gradient is a special effect in which an object changes color gradually. Each color in a gradient is represented by a stop. The first stop is stop 0, the second is stop 1, and so on. You can specify any number of stops in the special effects for a subcomponent of a graph that supports special effects. You can define gradient special effects for the following subcomponents of a graph: