Oracle Fusion Middleware Data Visualization Tools Tag Reference for Oracle ADF Faces
12c (12.1.2)

E23187-01

<dvt:shapeAttributes>

shapeAttributes shape attributes


Specifies interactivity properties on subcomponents of a graph and gauge component. This function provides a connection between a specific subcomponent, and an HTML attribute or a javascript event. One common example is that users may use a bar of a graph or the indicator of a gauge to trigger a hyper-link action. Each shape attribute tag must contain a subcomponent and at least one attribute in order to be functional. Example: dvt:shapeAttributes component="component_A" onClick="#{backing_bean_B}"

In general, there are two types of attributes - behavior attributes and common attributes. All "behavior" attributes consist of a Javascript handler, and all of them have prefix "on" in their names. All other attributes are called "common" attributes.

Behavior Attributes - A behavior attribute, such as onClick, onMouseMove, onKeyDown etc, takes a string that contains javascript code or a reference to a backing bean method that returns javascript code, as its value. The browser will run the javascript code when a specific action occurs depending on which attribute. If the value is a backing bean method, the method takes the subcomponent handle as its input parameter, see the example code below:

Common Attributes - Some common attributes take a string or a backing bean method that returns a string as their values, namely alt, herf, noherf, target, title and tabindex. Examples:

Other common attributes control the basic settings of the interactivity. User can specify a subcomponent for the shape attribute by component attribute, the identifier of the subcomponent by id attribute, and the controls over the click events by clickable, clickAction and clickListener attributes.

Relationship with other tags

The shapeAttributes tag is a child of the shapeAttributesSet tag.

The shapeAttributes tag has no child tags.

Example 1

The following example shows XML for shapeAttributes tags associated with the gauge indicator and the gauge metric label.

   <dvt:gauge > 
      <dvt:shapeAttributesSet>
         <dvt:shapeAttributes component="GAUGE_INDICATOR" alt="#{sampleGauge.alt}" onClick="#{sampleGauge.onClick}"/>
          <dvt:shapeAttributes component="GAUGE_METRICLABEL" alt="#{sampleGauge.alt}" onMouseMove="#{sampleGauge.onMouseMove}"/>
      </dvt:shapeAttributesSet> 
   </dvt:gauge>
            

In the backing bean (sampleGauge):

public String alt(oracle.dss.dataView.ComponentHandle handle) { 
                      return handle.getName(); } 
                   public String onClick(oracle.dss.dataView.ComponentHandle handle) { 
                      return ("document.title=\"onClick\";"); } 
                   public String onMouseMove(oracle.dss.dataView.ComponentHandle handle) {
                      return ("document.title=\"onMouseMove\";"); }

Alternatively, user may use a string as the value for the attributes (without using backing bean methods)

   <dvt:gauge > 
      <dvt:shapeAttributesSet>
         <dvt:shapeAttributes component="GAUGE_INDICATOR" alt="Indicator" onClick="document.title="onClick";"/>
         <dvt:shapeAttributes component="GAUGE_METRICLABEL" alt="MetricLabel" onMouseMove="document.title="onMouseMove";"/> 
      </dvt:shapeAttributesSet> 
   </dvt:gauge>
   

Example 2

The following example shows how to use a clickListener. Example code in a JSPX page:

   <dvt:areaGraph > 
      <dvt:shapeAttributesSet>
         <dvt:shapeAttributes component="GRAPH_AREAMARKER" clickable="true" clickListener="#{sampleGraph.clickListener}"/>
      </dvt:shapeAttributesSet> 
   </dvt:gauge>
   

Example code in the backing bean (sampleGraph):

   public void clickListener(ClickEvent ce) {
      System.out.println(ce.getComponentHandle().getComponentInfo().toString()); 
   }
      

When the area marker is clicked, the debug window will print the component info, which is "series = XXX".

Example 3

Another example for clickListener. The ClickEvent contains the information about the data point. Sample code:

    public void processClick(ClickEvent event) { 
       ComponentHandle handle = event.getComponentHandle(); 
       if(handle instanceof DataComponentHandle) { 
          DataComponentHandle dhandle = (DataComponentHandle)handle; System.out.println("value " + dhandle.getValue(DataComponentHandle.UNFORMATTED_VALUE));
          System.out.println("row key " + dhandle.getValue(DataComponentHandle.ROW_KEY));
          System.out.println("key path " + dhandle.getValue(DataComponentHandle.KEY_PATH)); 
          Attributes[] seriesInfo = dhandle.getSeriesAttributes(); 
          if(seriesInfo != null) { 
             for(Attributes attrs: seriesInfo) { 
                System.out.println("Series attribute value " + attrs.getValue(Attributes.LABEL_VALUE));
                System.out.println("Series attribute name " + attrs.getValue(Attributes.LABEL_ATTRIBUTE));
                System.out.println("Series attribute value id " + attrs.getValue(Attributes.ID_VALUE));
                System.out.println("Series attribute name id " + attrs.getValue(Attributes.ID_ATTRIBUTE)); } } 
                Attributes [] groupInfo = dhandle.getGroupAttributes(); 
                if(groupInfo != null) { 
                   for(Attributes attrs: groupInfo) { 
                      System.out.println("Group attribute value " + attrs.getValue(Attributes.LABEL_VALUE));
                      System.out.println("Group attribute name " + attrs.getValue(Attributes.LABEL_ATTRIBUTE)); } } } 
                      //handle could be an instance of ScatterDataComponentHandle for scatter graphs, 
                      //BubbleDataComponentHandle for bubble graphs and StockDataComponentHandle 
                      //for stock graphs to fetch additional information 
                      //handle could be an index of GroupComponentHandle if clicked on 
                      //group component such as o1TickLabel 
                      //handle could be an index of SeriesComponentHandle if clicked on 
                      //series component such as legendText, legendTitle 
                      }
                   }
               }
           }
       }
        

Attributes

Name Type Supports EL? Description
id java.lang.String no Specifies the identifier for the component
component java.lang.String no The subcomponents of an ADF component that can be designated as capable of interactivity. Valid values for graphs are:
  • GRAPH_AREAMARKER - the colored area representing data of area graph
  • GRAPH_DATALINE - the lines representing data in line, and radar graph
  • GRAPH_DATAMARKER - the point or shape representing data in scatter, polar, and bubble graph
  • GRAPH_DRILLMARKER - the drill marker is the icon showing the hide and show drill label
  • GRAPH_DRILLTEXT - the text of the drill labels
  • GRAPH_LEGENDMARKER - the colored icons in the legend area
  • GRAPH_LEGENDTEXT - the labels of the text in the legend area
  • GRAPH_MARKERTEXT - the text showing the value represented by the data marker
  • GRAPH_O1DRILLLABEL - the drill label in the ordinary / category axis
  • GRAPH_O1TICKLABEL - the labels of the item in the ordinary / category axis
  • GRAPH_O1TITLE - the title of the ordinary / category axis
  • GRAPH_PARETOLINE - the lines representing data in pareto graph
  • GRAPH_PARETOMARKER - the points on the lines that representing data in pareto graph
  • GRAPH_PIELABEL - the label below a pie graph
  • GRAPH_SLICE - a slice on a pie graph
  • GRAPH_SLICELABEL - the label of a slice in a pie graph
  • GRAPH_STOCKMARKER - the data lines of a stock graph
  • GRAPH_GRAPH_THREEDMARKER - the 3D bars representing data of 3D graphs
  • GRAPH_TWODMARKER - the 2D bars representing data of a bar graph, pareto graph or the 2D bar next to a pie bar graph
  • GRAPH_VOLUMEMARKER - the volume bar of a stock graph
  • GRAPH_X1TICKLABEL - the labels showing values of x1 data axis
  • GRAPH_X1TITLE - the title of x1 data axis
  • GRAPH_Y1TICKLABEL - the labels showing values of y1 data axis
  • GRAPH_Y2TICKLABEL - the labels showing values of y2 data axis
  • GRAPH_Y1TITLE - the title of y1 data axis
  • GRAPH_Y2TITLE - the title of y2 data axis
  • GRAPH_ZDRILLLABEL - the drill label of z data axis, only relevant to 3D graphs
  • GRAPH_ZTICKLABEL - the labels showing values of z data axis, only relevant to 3D graphs
  • GRAPH_ZTITLE - the title of z data axis, only relevant to 3D graphs

Valid values for gauges are:

  • GAUGE_BOTTOMLABEL - the label below the gauge
  • GAUGE_INDICATOR - the indicator in the gauge
  • GAUGE_LEGENDAREA - the legend area of the gauge
  • GAUGE_LEGENDTEXT - the text label of the legend area
  • GAUGE_METRICLABEL - the label showing the metric value
  • GAUGE_TOPLABEL - the label above the gauge
  • GAUGE_PLOTAREA - the area inside the gauge
clickListener java.lang.String no Refers to a backing bean method that takes a ClickEvent as an argument. The method will be process when the subcomponent is clicked. Only works in FLASH image formatted graph or gauge.
clickAction java.lang.String no A reference to backing bean action method that will be called when the subcomponent is clicked, or the static outcome of the action. Only works in FLASH image formatted graph or gauge.
clickable java.lang.String no A reference to a backing bean method that takes oracle.dss.dataView.ComponentHandle and returns a boolean value indicating whether a ClickEvent should be fired when this subcomponent is clicked. This can also be a static value "true" or "false". Only works in FLASH image formatted graph or gauge.
formatType java.lang.String no Specifies whether a text component appears as a hyperlink or normal. Valid values are:
  • LINKED_TEXT - Appears as a hyperlink
  • NONE - (Default) Appears as normal
alt java.lang.String no

Common Attributes

In the following section, (includes alt, href, tabindex, nohref, target, title) each attribute takes either a value or a reference to a backing bean method that takes oracle.dss.dataView.ComponentHandle, which returns a value. The value can be a string, or a boolean depending on the attribute. The following attributes have the usage of the value listed.

A reference to a backing bean method that takes oracle.dss.dataView.ComponentHandle and returns String. This String is set as the alt text of the component, and will be displayed as a tooltip when a user hovers over the component.

href java.lang.String no A reference to a backing bean method that takes oracle.dss.dataView.ComponentHandle and returns value of HREF HTML attribute. This creates a link to the href value on the component.
tabindex java.lang.String no The value is a string, which is the tabindex value. It represents the order of the focus on the component when tabbing through keyboard.
nohref java.lang.String no The value is a boolean, which indicates whether if NOHREF should be rendered for this component. If NOHREF is assigned true to this component, HREF will be disabled, otherwise HREF will be enabled.
target java.lang.String no The value is a string, which represents the TARGET HTML attribute. Target attribute specifies the where the web browser to open a hyperlink. Four pre-defined targets are _blank, _self, _parent, and _top. User can also specify a descriptive name with an underscore.
title java.lang.String no The value is a string, which represents the TITLE HTML attribute. The value of the title attribute annotates the component.
onClick java.lang.String no

Behavior Attributes

In the following section, all attributes are behavior attributes. Each attribute takes either a string or a reference to a backing bean method that takes oracle.dss.dataView.ComponentHandle as its input argument, which returns a string. Either way, the string that returns is a piece of javascript code that get executed when the attribute is triggered. The following attributes have trigger conditions as listed.

When the subcomponent gets clicked.

onDblClick java.lang.String no When the subcomponent gets double clicked.
onFocus java.lang.String no When the subcomponent gets the focus. Only works in PNG image formatted graph or gauge.
onBlur java.lang.String no When the subcomponent loses the focus. Only works in PNG image formatted graph or gauge.
onKeyPress java.lang.String no When the subcomponent has the focus and a keyboard key is pressed down and released. Only works in PNG image formatted graph or gauge.
onKeyDown java.lang.String no When the subcomponent has the focus and a keyboard key is pressed down. Only works in PNG image formatted graph or gauge.
onKeyUp java.lang.String no When the subcomponent has the focus and a keyboard key is released. Only works in PNG image formatted graph or gauge.
onMouseMove java.lang.String no When the mouse pointer gets over the subcomponent.
onMouseOver java.lang.String no When the mouse pointer moves away from the subcomponent.
onMouseOut java.lang.String no When the mouse pointer is moved inside the subcomponent.
onMouseDown java.lang.String no When a mouse button is pressed down inside the subcomponent.
onMouseUp java.lang.String no When a mouse button is released inside the subcomponent.