Show TOC Start of Content Area

Background documentation Data Binding of a BusinessGraphics UI Element  Locate the document in its SAP Library structure

Overview

The BusinessGraphics UI element can be used for displaying data in a chart. A business graphic can contain categories, which represent a discrete value range describing - for example - the months or quarters of a year. The categories of a business graphic are displayed on the x-axis in a vertical bar chart. In a pie chart, however, the categories represent the individual pie chart sections and the size of these sections represent the data series. The chart types scatter, portfolio, the charts for the milestone trend analysis, and its subtypes like TimeScatter belong to the non category-based charts. A BusinessGraphics UI element can contain only one category object. You can bind the description property of the category object to a context attribute. If the description property of the category object is bound to a context attribute, the context provides the description of the individual categories at runtime. The wdDolnit method of the controller implementation can fill the context with data at runtime.

In addition, each BusinessGraphics UI element contains at least one data series that can be either of the SimpleSeries type for simple charts, such as vertical bar charts and pie charts, or of the Series type. You should use data series of the Series type for complex chart types like scatter, Gantt, or portfolio that require the definition of an x value. The relationships of the BusinessGraphics UI element to the associated classes and its subclasses are described in the Metamodel of the UI element.

The data binding type of a BusinessGraphics UI element depends on the chart type you want to use. To display a particular chart type, you require a corresponding context structure. The structure of the BusinessGraphics UI element must be represented in the context structure.

Data Binding of Individual BusinessGraphics UI Elements

BusinessGraphics UI Element

The seriesSource property of the BusinessGraphics UI element is bound to a context node, under which all data for the data series resides.

Note

For more information about the use of a business graphic, see Using Business Graphics. For a description of the individual steps and procedures, see Inserting a BusinessGraphics UI Element.

 

Category Subelement

The subelement is only used for the category-based charts.You can bind the description property of the category object to a context attribute that can be used for specifying category names. The description property is usually bound to a sibling value attribute of the value property of the SimpleSeries object, because the number of data series values should be identical to the number of categories. Therefore, each element of the context node specifies a category.

The binding of the tooltip property is optional.

      If you bind the tooltip property to a context attribute, each category contains a different tooltip.

      If you assign a value to the tooltip property instead of binding it to a context attribute, all categories contain the same tooltip.

 

SimpleSeries Subelement

      Each SimpleSeries subelement of a BusinessGraphics UI element represents a data series. The SimpleSeries subelement is used for a simple, category-based chart in which each point contains only a value of the type y. The value property is bound to a context attribute that provides the data series values. The context node superordinate to the context attribute provides all node elements at runtime. The number of node elements equals the number of data points of a simple data series. Since only the context node with the lead selection provides data, it does not matter if the context node is defined as a singleton node or a non-singleton node.

 

Series Subelement

Each Series subelement of a BusinessGraphics UI element represents a multiple data series, and multiple Series subelements can be combined in a chart. The Series subelement is used for more complex data bindings. The seriesSource property of the BusinessGraphics UI element is bound to a context node superordinate to all context attributes that provide all relevant data for the data series.

This context node, which is bound to the seriesSource UI element property, provides all node elements at runtime. The number of these node elements at runtime equals the number of data series for the Series subelement.

The pointSource property must be bound to a context node that is the child of the context node to which the seriesSource UI element property is bound. The number of elements that this node contains at runtime determines the number of data series points to be displayed. If all bindable properties of the Series subelement are to be bound, they must be bound to context attributes that are children of this parent node. You can specify the context attributes that should apply to the whole data series. If the label property, for example, is bound to a context attribute, all elements of the assigned data series have the same value for the label property. However, the value of the labelproperty is different for additional data series because they are bound to different context attributes. Alternatively, you do not need to bind these properties of the Series subelement. In this case, all data series have the same value for these properties.

The values of the data series are specified using the subelements Point and Value, NumericValue, or TimeValue. This allows the display of category-based and non-category-based graphics.

 

Point Subelement

The pointSourceproperty of the Series subelement must be bound to a context node that is the child of the context node to which the seriesSource property of the BusinessGraphics UI element is bound. All other bindable properties – such as label and tooltip – must be bound to the context attributes that are children of the context node to which the valueSource property of the Point subelement is bound. You can specify the context attributes that apply to the points. If the labelproperty, for example, is bound to a context attribute, all points of the assigned data series have different values for the label property. However, the bindable properties of the Point subelement do not have to be bound. In this case, all data series have the same value for these properties.

If all points have the same number of values and the number of values is known at runtime, you do not need a separate data source fort he valueSource UI element property. The valueSource UI element property is then bound to the same context node as the pointSource UI element property of the Series subelement.

However, if different points in a data series contain different numbers of values (as is often the case for portfolio charts), you must specify a separate data sources for the valueSource UI element property. The valueSource UI element property must be bound to a child of the context node that is bound to the pointSource UI element property of the Series subelement.

Value Subelement

The Value subelement that is represented by the subelements NumericValue and TimeValue specifies the actual values of a point.

In general, the valueproperty of the NumericValue subelement or TimeValuesubelement must be bound to a context attribute of the context node to which the valueSource property of the Point subelement is bound.

To make data binding as flexible as possible, you have several options for displaying the data:

...

       1.      The valueSource property of the Point subelement is bound to the same context node as the pointSource property of the Series subelement. If the typeproperty of the NumericValue subelement is not bound, but set permanently to a specific type, each point has a value with a fixed type.

       2.      The valueSource property of the Point subelement is bound to the same context node as the pointSource property of the Series subelement. If the typeproperty of the NumericValue subelement is bound to a sibling attribute of the value property, each point has a value whose type can be different for each point.

       3.      The valueSource property of the Point subelement is bound to a context node that is the child of the node to which the pointSource property of the Series subelement is bound. If the type property of the NumericValue subelement is bound to a sibling attribute of the value property, each point has any number of values of different types.

       4.      The valueSource property of the Point subelement is bound to the same context node as the pointSource property of the Series subelement. The value property of the TimeValue subelement must be bound to a context attribute subordinate to the context node to which the valueSource property of the Point subelement is bound.

       5.      Any combination of points 1 to 4 is possible; multiple and different points exist.

End of Content Area