Customizing Pareto Graphs Customizing the Appearance of Specific Graph Types

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: Using ADF Graph Components 24-43 ■ Graph background: Use the dvt:background tag. ■ Graph plot area: Use the dvt:graphPlotArea tag. ■ Graph pie frame: Use the dvt:graphPieFrame tag. ■ Legend area: Use the dvt:legendArea tag. ■ Series: Use the dvt:series tag. ■ Time selector: Use the dvt:timeSelector tag. ■ Reference area: Use the dvt:referenceObject tag. The approach that you use to define gradient special effects is identical for each part of the graph that supports these effects.

24.8.2.1 How to Add Gradient Special Effects to a Graph

For each subcomponent of a graph to which you want to add special effects, you must insert a dvt:specialEffects tag as a child tag of the subcomponent. For example, if you want to add a gradient to the background of a graph, then you would create one dvt:specialEffects tag that is a child of the dvt:background tag. Then, optionally if you want to control the rate of change for the fill color of the subcomponent, you would insert as many dvt:gradientStopStyle tags as you need to control the color and rate of change for the fill color of the component. These dvt:gradientStopStyle tags then must be inserted as child tags of the single dvt:specialEffects tag. To add a gradient special effect to the background of a graph: 1. In the Structure window, right-click the dvt:background node that is a child of the graph node, then choose Insert inside dvt:background, then Special Effects.

2. Use the Property Inspector to enter values for the attributes of the

dvt:specialEffects tag:

a. For fillType attribute, choose FT_GRADIENT.

For gradientDirection attribute, select the direction of change that you want to use for the gradient fill.

b. For numStops attribute, enter the number of stops to use for the gradient.

3. Optionally, in the Structure window, right-click the dvt:specialEffects node

and choose Insert within dvt:specialEffects dvt:gradientStopStyle if you want to control the color and rate of change for each gradient stop.

4. Use the Property Inspector to enter values for the attributes of the

dvt:gradientStopStyle tag:

a. For the stopIndex attribute, enter a zero-based integer as an index within the

dvt:gradientStopStyle tags that are included within the specialEffects tag. Note: By default, a graph’s series gradient is set in the seriesEffect attribute with a value of SE_AUTO_GRADIENT to make the data markers appear smoother and apply graphic antialiasing. You must set the attribute to SE_NONE in order to specify a custom series gradient.