<dvt:attributeFormat>

attributeFormat attribute format


Graph typically uses categorical attributes ( e.g. product, geography, year, etc. ) on an ordinal axis and for the marker tooltips. To specify how categorical attributes should be formatted, an application needs to specify <dvt:attributeFormat> tag for each categorical attribute to be formatted. The <dvt:attributeFormat> tag needs to identify the categorical attribute that is being formatted by name as well as specify a converter to use when formatting the attribute. For example,

            <dvt:barGraph id="barGraph1" value="#{bindings.EmpView1.graphModel}" subType="BAR_VERT_CLUST">
                      <dvt:attributeFormat id="af1" name="Hiredate">
                          <af:convertDateTime pattern = "yyyy-MM-dd hh:mm:ss a"  timeZone="US/Pacific"/>
                      </dvt:attributeFormat>
             </dvt:barGraph>
            

The name of the categorical attribute is the name of the attribute/layer that was added to the Graph DataModel. The Graph model can be set declaratively by updating the pagedef. Here is the associated view pagedef for the above graph:

             <graph IterBinding="EmpView1Iterator" id="EmpView1"
                       xmlns="http://xmlns.oracle.com/adfm/dvt" type="BAR_VERT_CLUST">
                <graphDataMap leafOnly="true">
                    <series>
                      <data>
                         <item value="Bonus"/>
                      </data>
                    </series>
                    <groups>
                       <item value="Hiredate"/>
                    </groups>
                </graphDataMap>
             </graph>
            

Configuring Date Formatting

If there is a single categorical Date attribute being displayed on the O1Axis, then Graph displays a TimeAxis instead of the typical O1 / Ordinal Axis. The TimeAxis will show dates in a hierarchical format as opposed to as a single label on an O1 Axis ( e.g. June 27, 2001 ). To show a single label on the O1 Axis, the TimeAxis should be turned off ( e.g. timeAxisType="TAT_OFF" ) and a <dvt:attributeFormat> should be used to specify the date format.

Relationship with other tags

This component must be a child of one of the following components:

The attributeFormat tag can have the following child tags: convertNumber, convertDateTime, convertColor.

Attributes

Name Type Supports EL? Description
id java.lang.String no Specifies the identifier for the component
name java.lang.String yes Specifies the name of the attribute to which the child converter tag is applied. This value should match a layer name defined in the model.