class sap.ui.mdc.chart.MeasureItem

Visiblity: restricted
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/mdc/chart/MeasureItem
Application Component: CA-UI5-MDC

The Item for the field/property metadata used within MDC controls, an instance can be created to override the default/metadata behavior.

Note:

The control is experimental and the API/behaviour is not finalised and hence this should not be used for productive usage.


Constructor

Constructor for a new measure Item.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.ui.mdc.chart.MeasureItem(sId?, mSettings?)
Param Type Default Value Description
sId? string

ID for the new control, generated automatically if no ID is given

mSettings? object

initial settings for the new control


Properties

Name Type Default Value Description
aggregationMethod string undefined

The aggregation method which depends on the data service.

For OData based services this can be min,max,sum,average

Visibility: public
dataPoint object

The measures data point for coloring

A data point is an object that defines relation between measures and criticality it is inspired by a @com.sap.vocabularies.UI.v1.DataPoint used in the odata protocol

Its structure is:

  • targetValue: the target value (path to reference measure)
  • foreCastValue: the forcast value (path to a projected measure)
  • criticality: the criticality object


Since: 1.64.

Visibility: public
propertyPath string

The property path of the chart item which may differ from the corresponsing property

Visibility: public
role string axis1

How values of Measure will be rendered in the chart. Possible role values are axis1, axis2, axis3, and axis4. The default is axis1. They correspond to the well-known concepts of axis identifiers in the Cartesian coordinate system, e.g. a Y-axis in a bar/column/line chart, an X- and a Y-axis in a scatter chart, or two Y-axes in bar charts, and an optional third axis for the weight/size/intensity/temperature of a data point.

You can create a new measure as follow:

...
new sap.chart.data.Measure({name: "MEASURE1", role: sap.chart.data.MeasureRoleType.axis1})
...

Detailed usage of measure role. Please refer to MeasureRoleType

NOTE: Role definition would not work for Bullet Chart and users need to set semantics instead.

Visibility: public

Borrowed Properties

Name Type Default Value Description
key string

The unique identifier of the chart item which reflects to the name of the data property in the resulting data set

Visibility: public
label string

Label for the item, either as a string literal or by a pointer using the binding syntax to some property containing the label.

NOTE: This property was bound internally if automatically created via metadata of oData service and please call "unbindProperty" before setting.

Visibility: public
type string string

The data type

Visibility: public
visible boolean true

The visibility of the chart item

Visibility: public

Methods Overview

Method Description
sap.ui.mdc.chart.MeasureItem.createVizChartItem

Creates a vizChart Item with given settings

sap.ui.mdc.chart.MeasureItem.extend

Creates a new subclass of class sap.ui.mdc.chart.MeasureItem with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.mdc.chart.Item.extend.

getAdditionalColoringMeasures

Retrieve the additional measures from coloring for initially equiping the chart

getAggregationMethod

Gets current value of property aggregationMethod.

The aggregation method which depends on the data service.

For OData based services this can be min,max,sum,average

Default value is undefined.

getDataPoint

Gets current value of property dataPoint.

The measures data point for coloring

A data point is an object that defines relation between measures and criticality it is inspired by a @com.sap.vocabularies.UI.v1.DataPoint used in the odata protocol

Its structure is:

  • targetValue: the target value (path to reference measure)
  • foreCastValue: the forcast value (path to a projected measure)
  • criticality: the criticality object

sap.ui.mdc.chart.MeasureItem.getMetadata

Returns a metadata object for class sap.ui.mdc.chart.MeasureItem.

getPropertyPath

Gets current value of property propertyPath.

The property path of the chart item which may differ from the corresponsing property

getRole

Gets current value of property role.

How values of Measure will be rendered in the chart. Possible role values are axis1, axis2, axis3, and axis4. The default is axis1. They correspond to the well-known concepts of axis identifiers in the Cartesian coordinate system, e.g. a Y-axis in a bar/column/line chart, an X- and a Y-axis in a scatter chart, or two Y-axes in bar charts, and an optional third axis for the weight/size/intensity/temperature of a data point.

You can create a new measure as follow:

...
new sap.chart.data.Measure({name: "MEASURE1", role: sap.chart.data.MeasureRoleType.axis1})
...

Detailed usage of measure role. Please refer to MeasureRoleType

NOTE: Role definition would not work for Bullet Chart and users need to set semantics instead.

Default value is "axis1".

getSettings

Retrieve the setting for translating the measure item to a viz chart measure

sap.ui.mdc.chart.MeasureItem.getVizItemSettings

Translate mdc measure item settings to viz chart measure settings

getVizItemType

Gets the type of the item (dimension or measure)

setAggregationMethod

Sets a new value for property aggregationMethod.

The aggregation method which depends on the data service.

For OData based services this can be min,max,sum,average

When called with a value of null or undefined, the default value of the property will be restored.

Default value is undefined.

setDataPoint

Set the data point for coloring.

Note the 'dataPoint' property is final

setPropertyPath

Sets a new value for property propertyPath.

The property path of the chart item which may differ from the corresponsing property

When called with a value of null or undefined, the default value of the property will be restored.

setRole

Role of the inner chart item, see @sap.ui.mdc.ChartItemRoleType

toChart

Pushes updates on the item to the inner chart

toVizChartItem

Returns a promise that resolves to a Vizchart Item with given metadata

sap.ui.mdc.chart.MeasureItem.createVizChartItem

Creates a vizChart Item with given settings

Param Type DefaultValue Description
mSettings any

settings for the item

sap.ui.mdc.chart.MeasureItem.extend

Creates a new subclass of class sap.ui.mdc.chart.MeasureItem with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.mdc.chart.Item.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

getAdditionalColoringMeasures

Retrieve the additional measures from coloring for initially equiping the chart

Param Type DefaultValue Description
mItems undefined

getAggregationMethod

Gets current value of property aggregationMethod.

The aggregation method which depends on the data service.

For OData based services this can be min,max,sum,average

Default value is undefined.

getDataPoint

Gets current value of property dataPoint.

The measures data point for coloring

A data point is an object that defines relation between measures and criticality it is inspired by a @com.sap.vocabularies.UI.v1.DataPoint used in the odata protocol

Its structure is:

sap.ui.mdc.chart.MeasureItem.getMetadata

Returns a metadata object for class sap.ui.mdc.chart.MeasureItem.

getPropertyPath

Gets current value of property propertyPath.

The property path of the chart item which may differ from the corresponsing property

getRole

Gets current value of property role.

How values of Measure will be rendered in the chart. Possible role values are axis1, axis2, axis3, and axis4. The default is axis1. They correspond to the well-known concepts of axis identifiers in the Cartesian coordinate system, e.g. a Y-axis in a bar/column/line chart, an X- and a Y-axis in a scatter chart, or two Y-axes in bar charts, and an optional third axis for the weight/size/intensity/temperature of a data point.

You can create a new measure as follow:

...
new sap.chart.data.Measure({name: "MEASURE1", role: sap.chart.data.MeasureRoleType.axis1})
...

Detailed usage of measure role. Please refer to MeasureRoleType

NOTE: Role definition would not work for Bullet Chart and users need to set semantics instead.

Default value is "axis1".

getSettings

Retrieve the setting for translating the measure item to a viz chart measure

Param Type DefaultValue Description
mMetadataSettings undefined

sap.ui.mdc.chart.MeasureItem.getVizItemSettings

Translate mdc measure item settings to viz chart measure settings

Param Type DefaultValue Description
mMetadataSettings undefined

getVizItemType

Gets the type of the item (dimension or measure)

setAggregationMethod

Sets a new value for property aggregationMethod.

The aggregation method which depends on the data service.

For OData based services this can be min,max,sum,average

When called with a value of null or undefined, the default value of the property will be restored.

Default value is undefined.

Param Type DefaultValue Description
sAggregationMethod string

New value for property aggregationMethod

setDataPoint

Set the data point for coloring.

Note the 'dataPoint' property is final

Param Type DefaultValue Description
oValue undefined

setPropertyPath

Sets a new value for property propertyPath.

The property path of the chart item which may differ from the corresponsing property

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sPropertyPath string

New value for property propertyPath

setRole

Role of the inner chart item, see @sap.ui.mdc.ChartItemRoleType

Param Type DefaultValue Description
vRole undefined

The role of the inner chart item

toChart

Pushes updates on the item to the inner chart

Param Type DefaultValue Description
oChart object

chart to push the update to

toVizChartItem

Returns a promise that resolves to a Vizchart Item with given metadata

Param Type DefaultValue Description
mMetadata undefined

given metadata for the item