Class sap.suite.ui.microchart.ComparisonMicroChartModule: sap/suite/ui/microchart/ComparisonMicroChart

extends Control

Illustrates values as colored bar charts with title, numeric value, and scaling factor in the content area. This control replaces the deprecated sap.suite.ui.commons.ComparisonChart.


Since: 1.34.
Constructor Summary
new sap.suite.ui.microchart.ComparisonMicroChart(sId?, mSettings?)Constructor for a new ComparisonMicroChart control.
Event Summary
press(oControlEvent)The event is triggered when the chart is pressed.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.suite.ui.microchart.ComparisonMicroChart.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.suite.ui.microchart.ComparisonMicroChart with name sClassName and enriches it with the information contained in oClassInfo.
sap.suite.ui.microchart.ComparisonMicroChart.getMetadata()Returns a metadata object for class sap.suite.ui.microchart.ComparisonMicroChart.
addData(oData)Adds some data to the aggregation data.
attachPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the press event of this sap.suite.ui.microchart.ComparisonMicroChart.
bindData(oBindingInfo)Binds aggregation data to model data.
destroyData()Destroys all the data in the aggregation data.
detachPress(fnFunction, oListener)Detaches event handler fnFunction from the press event of this sap.suite.ui.microchart.ComparisonMicroChart.
firePress(mArguments?)Fires event press to attached listeners.
getColorPalette()Gets current value of property colorPalette.
getData()Gets content of aggregation data.
getHeight()Gets current value of property height.
getIsResponsive()Gets current value of property isResponsive.
getScale()Gets current value of property scale.
getShrinkable()Gets current value of property shrinkable.
getSize()Gets current value of property size.
getView()Gets current value of property view.
getWidth()Gets current value of property width.
indexOfData(oData)Checks for the provided sap.suite.ui.microchart.ComparisonMicroChartData in the aggregation data.
insertData(oData, iIndex)Inserts a data into the aggregation data.
removeAllData()Removes all the controls from the aggregation data.
removeData(vData)Removes a data from the aggregation data.
setColorPalette(sColorPalette)Sets a new value for property colorPalette.
setHeight(sHeight)Sets a new value for property height.
setIsResponsive(bIsResponsive)Sets a new value for property isResponsive.
setScale(sScale)Sets a new value for property scale.
setShrinkable(bShrinkable)Sets a new value for property shrinkable.
setSize(sSize)Sets a new value for property size.
setView(sView)Sets a new value for property view.
setWidth(sWidth)Sets a new value for property width.
unbindData()Unbinds aggregation data from model data.
Constructor Detail
new sap.suite.ui.microchart.ComparisonMicroChart(sId?, mSettings?)
Constructor for a new ComparisonMicroChart control.

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

The supported settings are:

  • Properties
    • size : sap.m.Size (default: Auto)
    • scale : string (default: )
    • width : sap.ui.core.CSSSize
    • view : sap.suite.ui.microchart.ComparisonMicroChartViewType (default: Normal)
    • colorPalette : string[] (default: [])
    • shrinkable : boolean (default: false)
    • height : sap.ui.core.CSSSize
    • isResponsive : boolean (default: false)
  • Aggregations
    • data : sap.suite.ui.microchart.ComparisonMicroChartData[] (default)
  • Events
    • press : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
{string}sId? ID for the new control, generated automatically if no ID is given
{object}mSettings? Initial settings for the new control
Event Detail
press(oControlEvent)
The event is triggered when the chart is pressed.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.suite.ui.microchart.ComparisonMicroChart.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.suite.ui.microchart.ComparisonMicroChart 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.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.suite.ui.microchart.ComparisonMicroChart.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.suite.ui.microchart.ComparisonMicroChart.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
Adds some data to the aggregation data.
Parameters:
{sap.suite.ui.microchart.ComparisonMicroChartData}oData the data to add; if empty, nothing is inserted
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
attachPress(oData?, fnFunction, oListener?): sap.suite.ui.microchart.ComparisonMicroChart
Attaches event handler fnFunction to the press event of this sap.suite.ui.microchart.ComparisonMicroChart.

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.suite.ui.microchart.ComparisonMicroChart itself.

The event is triggered when the chart is pressed.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.suite.ui.microchart.ComparisonMicroChart itself
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
Binds aggregation data to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

Parameters:
{object}oBindingInfo The binding information
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
Destroys all the data in the aggregation data.
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
detachPress(fnFunction, oListener): sap.suite.ui.microchart.ComparisonMicroChart
Detaches event handler fnFunction from the press event of this sap.suite.ui.microchart.ComparisonMicroChart.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
Fires event press to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
getColorPalette(): string[]
Gets current value of property colorPalette.

The color palette for the chart. If this property is set, semantic colors defined in ComparisonData are ignored. Colors from the palette are assigned to each bar consequentially. When all the palette colors are used, assignment of the colors begins from the first palette color.

Default value is [].

Returns:
{string[]} Value of property colorPalette
Gets content of aggregation data.

The comparison chart bar data.

Returns:
{sap.suite.ui.microchart.ComparisonMicroChartData[]}
getHeight(): sap.ui.core.CSSSize
Gets current value of property height.

Height of the chart.

Returns:
{sap.ui.core.CSSSize} Value of property height
getIsResponsive(): boolean
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. Size and Width properties are ignored in such case.

Default value is false.

Since:
1.38.0
Returns:
{boolean} Value of property isResponsive
getScale(): string
Gets current value of property scale.

The scaling suffix that is added to the actual and target values.

Default value is .

Returns:
{string} Value of property scale
getShrinkable(): boolean
Gets current value of property shrinkable.

If it is set to true, the height of the control is defined by its content.

Default value is false.

Returns:
{boolean} Value of property shrinkable
getSize(): sap.m.Size
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.

Default value is Auto.

Returns:
{sap.m.Size} Value of property size
Gets current value of property view.

The view of the chart. If not set, the Normal view is used by default.

Default value is Normal.

Returns:
{sap.suite.ui.microchart.ComparisonMicroChartViewType} Value of property view
getWidth(): sap.ui.core.CSSSize
Gets current value of property width.

The width of the chart. If it is not set, the size of the control is defined by the size property.

Returns:
{sap.ui.core.CSSSize} Value of property width
indexOfData(oData): int
Checks for the provided sap.suite.ui.microchart.ComparisonMicroChartData in the aggregation data. and returns its index if found or -1 otherwise.
Parameters:
{sap.suite.ui.microchart.ComparisonMicroChartData}oData The data whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
Inserts a data into the aggregation data.
Parameters:
{sap.suite.ui.microchart.ComparisonMicroChartData}oData the data to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the data should be inserted at; for a negative value of iIndex, the data is inserted at position 0; for a value greater than the current size of the aggregation, the data is inserted at the last position
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
Removes all the controls from the aggregation data.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.suite.ui.microchart.ComparisonMicroChartData[]} An array of the removed elements (might be empty)
Removes a data from the aggregation data.
Parameters:
{int|string|sap.suite.ui.microchart.ComparisonMicroChartData}vData The datato remove or its index or id
Returns:
{sap.suite.ui.microchart.ComparisonMicroChartData} The removed data or null
setColorPalette(sColorPalette): sap.suite.ui.microchart.ComparisonMicroChart
Sets a new value for property colorPalette.

The color palette for the chart. If this property is set, semantic colors defined in ComparisonData are ignored. Colors from the palette are assigned to each bar consequentially. When all the palette colors are used, assignment of the colors begins from the first palette color.

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

Default value is [].

Parameters:
{string[]}sColorPalette New value for property colorPalette
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
Sets a new value for property height.

Height of the chart.

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

Parameters:
{sap.ui.core.CSSSize}sHeight New value for property height
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
setIsResponsive(bIsResponsive): sap.suite.ui.microchart.ComparisonMicroChart
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. Size and Width properties are ignored in such case.

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

Default value is false.

Parameters:
{boolean}bIsResponsive New value for property isResponsive
Since:
1.38.0
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
Sets a new value for property scale.

The scaling suffix that is added to the actual and target values.

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

Default value is .

Parameters:
{string}sScale New value for property scale
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
Sets a new value for property shrinkable.

If it is set to true, the height of the control is defined by its content.

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

Default value is false.

Parameters:
{boolean}bShrinkable New value for property shrinkable
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
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.

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

Default value is Auto.

Parameters:
{sap.m.Size}sSize New value for property size
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
Sets a new value for property view.

The view of the chart. If not set, the Normal view is used by default.

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

Default value is Normal.

Parameters:
{sap.suite.ui.microchart.ComparisonMicroChartViewType}sView New value for property view
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
Sets a new value for property width.

The width of the chart. If it is not set, the size of the control is defined by the size property.

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

Parameters:
{sap.ui.core.CSSSize}sWidth New value for property width
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining
Unbinds aggregation data from model data.
Returns:
{sap.suite.ui.microchart.ComparisonMicroChart} Reference to this in order to allow method chaining