class sap.ui.comp.smartmicrochart.SmartMicroChart

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/comp/smartmicrochart/SmartMicroChart
Application Component: CA-UI5-SC

The SmartMicroChart control creates a chart based on OData metadata and the configuration specified by mSettings.
The entitySet property is required. This property is used to fetch metadata and annotation information from the specified default OData model. Depending on the UI/ChartType annotation, the control creates a corresponding SmartAreaMicroChart, SmartBulletMicroChart, SmartStackedBarMicroChart, SmartLineMicroChart, or SmartRadialMicroChart instance and delegates it to the internal control.
Note: Most of the attributes are not dynamic and cannot be changed once the control has been initialized.


Constructor

Constructor for a new sap.ui.comp.smartmicrochart.SmartMicroChart.

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.comp.smartmicrochart.SmartMicroChart(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
chartBindingPath string

This attribute can be used to specify the path that is used during the binding of the chart. If not specified, the entitySet attribute is used instead and also stored in this property. Calling bindElement binds the control and sets this property.

Visibility: public
chartType string

Specifies the type of chart. Note that this property is read-only.

Visibility: public
enableAutoBinding boolean false

If set to true, this enables automatic binding of the chart using the chartBindingPath (if it exists) or entitySet property.

Visibility: public
entitySet string

The entity set name to fetch data and create the internal chart representation from. Note that this is not a dynamic UI5 property.

Visibility: public
height sap.ui.core.CSSSize

The height of the chart. Overrides the height specified in the size property.

Visibility: public
isResponsive boolean false

If this set to true, width and height of the control are determined by the width and height of the container in which the control is placed or by the width and height property.

Visibility: public
showLabel boolean true

Determines if any label is shown or not

Visibility: public
size sap.m.Size Auto

The size of the microchart. If not set, the default size is applied based on the size of the device tile. Responsive size takes width and height of the parent container where the micro chart is included.

Since: 1.62.

Visibility: public
width sap.ui.core.CSSSize

The width of the chart. Overrides the width specified in the size property.

Visibility: public

Aggregations

Default Aggregation: _chart

Name Cardinality Type Description
_chart (default) 0..1 sap.ui.core.Control

This private aggregation is used for the internal instance of Smart<*>MicroChart.


Associations

Name Cardinality Type Description
ariaLabelledBy 0..n sap.ui.core.Control

Controls or IDs that label this control. Can be used by screen reader software.

Since: 1.60.0.

chartDescription 0..1 sap.m.Label

If the associated control is provided, its text property is set to the Description property of the Chart annotation. Description property of the DataPoint annotation is ignored.

chartTitle 0..1 sap.m.Label

If the associated control is provided, its text property is set to the Title property of the Chart annotation. Title property of the DataPoint annotation is ignored.

freeText 0..1 sap.m.Label

If the associated control is provided, its text property is set to the free text provided by annotations. The Value property of the DataPoint annotation should be annotated with this free text. As of 1.42.0, this association is only available for chart type 'Donut'.

Since: 1.42.0.

unitOfMeasure 0..1 sap.m.Label

If the associated control is provided, its text property is set to the Unit of Measure. The Value property of the DataPoint annotation should be annotated with this Unit of Measure. It can be either ISOCurrency or Unit from the OData Measures annotations.


Events Overview

Event Description
initialize

Event fired once the control has been initialized.

initialize

Event fired once the control has been initialized.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

Methods Overview

Method Description
addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

attachInitialize

Attaches event handler fnFunction to the initialize event of this sap.ui.comp.smartmicrochart.SmartMicroChart.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.comp.smartmicrochart.SmartMicroChart itself.

Event fired once the control has been initialized.

detachInitialize

Detaches event handler fnFunction from the initialize event of this sap.ui.comp.smartmicrochart.SmartMicroChart.

The passed function and listener object must match the ones used for event registration.

sap.ui.comp.smartmicrochart.SmartMicroChart.extend

Creates a new subclass of class sap.ui.comp.smartmicrochart.SmartMicroChart 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.core.Control.extend.

fireInitialize

Fires event initialize to attached listeners.

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getChartBindingPath

Gets current value of property chartBindingPath.

This attribute can be used to specify the path that is used during the binding of the chart. If not specified, the entitySet attribute is used instead and also stored in this property. Calling bindElement binds the control and sets this property.

getChartDescription

ID of the element which is the current target of the association chartDescription, or null.

getChartTitle

ID of the element which is the current target of the association chartTitle, or null.

getChartType

Gets current value of property chartType.

Specifies the type of chart. Note that this property is read-only.

getEnableAutoBinding

Gets current value of property enableAutoBinding.

If set to true, this enables automatic binding of the chart using the chartBindingPath (if it exists) or entitySet property.

Default value is false.

getEntitySet

Gets current value of property entitySet.

The entity set name to fetch data and create the internal chart representation from. Note that this is not a dynamic UI5 property.

getFreeText

ID of the element which is the current target of the association freeText, or null.

getHeight

Gets current value of property height.

The height of the chart. Overrides the height specified in the size property.

getIsResponsive

Gets current value of property isResponsive.

If this set to true, width and height of the control are determined by the width and height of the container in which the control is placed or by the width and height property.

Default value is false.

sap.ui.comp.smartmicrochart.SmartMicroChart.getMetadata

Returns a metadata object for class sap.ui.comp.smartmicrochart.SmartMicroChart.

getShowLabel

Gets current value of property showLabel.

Determines if any label is shown or not

Default value is true.

getSize

Gets current value of property size.

The size of the microchart. If not set, the default size is applied based on the size of the device tile. Responsive size takes width and height of the parent container where the micro chart is included.

Default value is "Auto".

getUnitOfMeasure

ID of the element which is the current target of the association unitOfMeasure, or null.

getWidth

Gets current value of property width.

The width of the chart. Overrides the width specified in the size property.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

setChartBindingPath

Sets a new value for property chartBindingPath.

This attribute can be used to specify the path that is used during the binding of the chart. If not specified, the entitySet attribute is used instead and also stored in this property. Calling bindElement binds the control and sets this property.

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

setChartDescription

Sets the associated chartDescription.

setChartTitle

Sets the associated chartTitle.

setEnableAutoBinding

Sets a new value for property enableAutoBinding.

If set to true, this enables automatic binding of the chart using the chartBindingPath (if it exists) or entitySet property.

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

Default value is false.

setEntitySet

Sets a new value for property entitySet.

The entity set name to fetch data and create the internal chart representation from. Note that this is not a dynamic UI5 property.

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

setFreeText

Sets the associated freeText.

setHeight

Sets a new value for property height.

The height of the chart. Overrides the height specified in the size property.

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

setIsResponsive

Sets a new value for property isResponsive.

If this set to true, width and height of the control are determined by the width and height of the container in which the control is placed or by the width and height property.

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

Default value is false.

setShowLabel

Sets a new value for property showLabel.

Determines if any label is shown or not

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

Default value is true.

setSize

Sets a new value for property size.

The size of the microchart. If not set, the default size is applied based on the size of the device tile. Responsive size takes width and height of the parent container where the micro chart is included.

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

Default value is "Auto".

setUnitOfMeasure

Sets the associated unitOfMeasure.

setWidth

Sets a new value for property width.

The width of the chart. Overrides the width specified in the size property.

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

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to add; if empty, nothing is inserted

attachInitialize

Attaches event handler fnFunction to the initialize event of this sap.ui.comp.smartmicrochart.SmartMicroChart.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.comp.smartmicrochart.SmartMicroChart itself.

Event fired once the control has been initialized.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.comp.smartmicrochart.SmartMicroChart itself

detachInitialize

Detaches event handler fnFunction from the initialize event of this sap.ui.comp.smartmicrochart.SmartMicroChart.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.ui.comp.smartmicrochart.SmartMicroChart.extend

Creates a new subclass of class sap.ui.comp.smartmicrochart.SmartMicroChart 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.core.Control.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

fireInitialize

Fires event initialize to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getChartBindingPath

Gets current value of property chartBindingPath.

This attribute can be used to specify the path that is used during the binding of the chart. If not specified, the entitySet attribute is used instead and also stored in this property. Calling bindElement binds the control and sets this property.

getChartDescription

ID of the element which is the current target of the association chartDescription, or null.

getChartTitle

ID of the element which is the current target of the association chartTitle, or null.

getChartType

Gets current value of property chartType.

Specifies the type of chart. Note that this property is read-only.

getEnableAutoBinding

Gets current value of property enableAutoBinding.

If set to true, this enables automatic binding of the chart using the chartBindingPath (if it exists) or entitySet property.

Default value is false.

getEntitySet

Gets current value of property entitySet.

The entity set name to fetch data and create the internal chart representation from. Note that this is not a dynamic UI5 property.

getFreeText

ID of the element which is the current target of the association freeText, or null.

getHeight

Gets current value of property height.

The height of the chart. Overrides the height specified in the size property.

getIsResponsive

Gets current value of property isResponsive.

If this set to true, width and height of the control are determined by the width and height of the container in which the control is placed or by the width and height property.

Default value is false.

sap.ui.comp.smartmicrochart.SmartMicroChart.getMetadata

Returns a metadata object for class sap.ui.comp.smartmicrochart.SmartMicroChart.

getShowLabel

Gets current value of property showLabel.

Determines if any label is shown or not

Default value is true.

getSize

Gets current value of property size.

The size of the microchart. If not set, the default size is applied based on the size of the device tile. Responsive size takes width and height of the parent container where the micro chart is included.

Default value is "Auto".

getUnitOfMeasure

ID of the element which is the current target of the association unitOfMeasure, or null.

getWidth

Gets current value of property width.

The width of the chart. Overrides the width specified in the size property.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy int sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to be removed or its index or ID

setChartBindingPath

Sets a new value for property chartBindingPath.

This attribute can be used to specify the path that is used during the binding of the chart. If not specified, the entitySet attribute is used instead and also stored in this property. Calling bindElement binds the control and sets this property.

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

Param Type DefaultValue Description
sChartBindingPath string

New value for property chartBindingPath

setChartDescription

Sets the associated chartDescription.

Param Type DefaultValue Description
oChartDescription sap.ui.core.ID sap.m.Label

ID of an element which becomes the new target of this chartDescription association; alternatively, an element instance may be given

setChartTitle

Sets the associated chartTitle.

Param Type DefaultValue Description
oChartTitle sap.ui.core.ID sap.m.Label

ID of an element which becomes the new target of this chartTitle association; alternatively, an element instance may be given

setEnableAutoBinding

Sets a new value for property enableAutoBinding.

If set to true, this enables automatic binding of the chart using the chartBindingPath (if it exists) or entitySet property.

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

Default value is false.

Param Type DefaultValue Description
bEnableAutoBinding boolean false

New value for property enableAutoBinding

setEntitySet

Sets a new value for property entitySet.

The entity set name to fetch data and create the internal chart representation from. Note that this is not a dynamic UI5 property.

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

Param Type DefaultValue Description
sEntitySet string

New value for property entitySet

setFreeText

Sets the associated freeText.

Param Type DefaultValue Description
oFreeText sap.ui.core.ID sap.m.Label

ID of an element which becomes the new target of this freeText association; alternatively, an element instance may be given

setHeight

Sets a new value for property height.

The height of the chart. Overrides the height specified in the size property.

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

Param Type DefaultValue Description
sHeight sap.ui.core.CSSSize

New value for property height

setIsResponsive

Sets a new value for property isResponsive.

If this set to true, width and height of the control are determined by the width and height of the container in which the control is placed or by the width and height property.

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

Default value is false.

Param Type DefaultValue Description
bIsResponsive boolean false

New value for property isResponsive

setShowLabel

Sets a new value for property showLabel.

Determines if any label is shown or not

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

Default value is true.

Param Type DefaultValue Description
bShowLabel boolean true

New value for property showLabel

setSize

Sets a new value for property size.

The size of the microchart. If not set, the default size is applied based on the size of the device tile. Responsive size takes width and height of the parent container where the micro chart is included.

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

Default value is "Auto".

Param Type DefaultValue Description
sSize sap.m.Size "Auto"

New value for property size

setUnitOfMeasure

Sets the associated unitOfMeasure.

Param Type DefaultValue Description
oUnitOfMeasure sap.ui.core.ID sap.m.Label

ID of an element which becomes the new target of this unitOfMeasure association; alternatively, an element instance may be given

setWidth

Sets a new value for property width.

The width of the chart. Overrides the width specified in the size property.

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

Param Type DefaultValue Description
sWidth sap.ui.core.CSSSize

New value for property width