Class sap.suite.ui.commons.ComparisonChartModule: sap/suite/ui/commons/ComparisonChart

extends Control

This control shows a comparison chart.

Deprecated API:Since version 1.34. Deprecated. sap.suite.ui.microchart.ComparisonMicroChart should be used.

Constructor Summary
new sap.suite.ui.commons.ComparisonChart(sId?, mSettings?)Constructor for a new ComparisonChart.
Event Summary
press(oControlEvent)The event is fired when the user chooses the comparison chart.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.suite.ui.commons.ComparisonChart.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.suite.ui.commons.ComparisonChart with name sClassName and enriches it with the information contained in oClassInfo.
sap.suite.ui.commons.ComparisonChart.getMetadata()Returns a metadata object for class sap.suite.ui.commons.ComparisonChart.
addData(oData)Adds some data oData to the aggregation named data.
attachPress(oData?, fnFunction, oListener?)Attach event handler fnFunction to the 'press' event of this sap.suite.ui.commons.ComparisonChart.
destroyData()Destroys all the data in the aggregation named data.
detachPress(fnFunction, oListener)Detach event handler fnFunction from the 'press' event of this sap.suite.ui.commons.ComparisonChart.
firePress(mArguments?)Fire event press to attached listeners.
getColorPalette()Getter for property colorPalette.
getData()Getter for aggregation data.
getHeight()Getter for property height.
getScale()Getter for property scale.
getShrinkable()Getter for property shrinkable.
getSize()Getter for property size.
getView()Getter for property view.
getWidth()Getter for property width.
indexOfData(oData)Checks for the provided sap.suite.ui.commons.ComparisonData in the aggregation named data and returns its index if found or -1 otherwise.
insertData(oData, iIndex)Inserts a data into the aggregation named data.
removeAllData()Removes all the controls in the aggregation named data.
removeData(vData)Removes an data from the aggregation named data.
setColorPalette(aColorPalette)Setter for property colorPalette.
setHeight(sHeight)Setter for property height.
setScale(sScale)Setter for property scale.
setShrinkable(bShrinkable)Setter for property shrinkable.
setSize(oSize)Setter for property size.
setView(oView)Setter for property view.
setWidth(sWidth)Setter for property width.
Constructor Detail
new sap.suite.ui.commons.ComparisonChart(sId?, mSettings?)
Constructor for a new ComparisonChart.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers.

If the name of a setting is ambiguous (e.g. a property has the same name as an event), then the framework assumes property, aggregation, association, event in that order. To override this automatic resolution, one of the prefixes "aggregation:", "association:" or "event:" can be added to the name of the setting (such a prefixed name must be enclosed in single or double quotes).

The supported settings are:

  • Properties
    • scale : string
    • size : sap.suite.ui.commons.InfoTileSize (default: sap.suite.ui.commons.InfoTileSize.Auto)
    • view : sap.suite.ui.commons.ComparisonChartView (default: sap.suite.ui.commons.ComparisonChartView.Normal)
    • width : sap.ui.core.CSSSize
    • colorPalette : string[] (default: [])
    • shrinkable : boolean (default: false)
    • height : sap.ui.core.CSSSize
  • Aggregations
    • data : sap.suite.ui.commons.ComparisonData[]
  • Associations
    • Events
      • press : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    Parameters:
    {string}sId? id for the new control, generated automatically if no id is given
    {object}mSettings? initial settings for the new control
    Deprecated:
    Since version 1.34. Deprecated. sap.suite.ui.microchart.ComparisonMicroChart should be used.
    Event Detail
    press(oControlEvent)
    The event is fired when the user chooses the comparison chart.
    Parameters:
    {sap.ui.base.Event}oControlEvent
    {sap.ui.base.EventProvider}oControlEvent.getSource
    {object}oControlEvent.getParameters
    Method Detail
    sap.suite.ui.commons.ComparisonChart.extend(sClassName, oClassInfo?, FNMetaImpl?): function
    Creates a new subclass of class sap.suite.ui.commons.ComparisonChart with name sClassName and enriches it with the information contained in oClassInfo.

    oClassInfo might contain the same kind of informations as described in Element.extend.

    Parameters:
    {string}sClassName name of the class to be created
    {object}oClassInfo? object literal with informations about the class
    {function}FNMetaImpl? constructor function for the metadata object. If not given, it defaults to sap.ui.core.ElementMetadata.
    Returns:
    {function} the created class / constructor function
    sap.suite.ui.commons.ComparisonChart.getMetadata(): sap.ui.base.Metadata
    Returns a metadata object for class sap.suite.ui.commons.ComparisonChart.
    Returns:
    {sap.ui.base.Metadata} Metadata object describing this class
    Adds some data oData to the aggregation named data.
    Parameters:
    {sap.suite.ui.commons.ComparisonData}oData the data to add; if empty, nothing is inserted
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining
    attachPress(oData?, fnFunction, oListener?): sap.suite.ui.commons.ComparisonChart
    Attach event handler fnFunction to the 'press' event of this sap.suite.ui.commons.ComparisonChart.
    . When called, the context of the event handler (its this) will be bound to oListener if specified otherwise to this sap.suite.ui.commons.ComparisonChart.
    itself.

    The event is fired when the user chooses the comparison chart.

    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 call, when the event occurs.
    {object}oListener? Context object to call the event handler with. Defaults to this sap.suite.ui.commons.ComparisonChart.
    itself.
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining
    Destroys all the data in the aggregation named data.
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining
    detachPress(fnFunction, oListener): sap.suite.ui.commons.ComparisonChart
    Detach event handler fnFunction from the 'press' event of this sap.suite.ui.commons.ComparisonChart.

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

    Parameters:
    {function}fnFunction The function to call, when the event occurs.
    {object}oListener Context object on which the given function had to be called.
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining
    firePress(mArguments?): sap.suite.ui.commons.ComparisonChart
    Fire event press to attached listeners.
    Parameters:
    {Map}mArguments? the arguments to pass along with the event.
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining
    getColorPalette(): string[]
    Getter 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.

    Default value is []

    Since:
    1.24
    Returns:
    {string[]} the value of property colorPalette
    Getter for aggregation data.
    The comparison chart data.
    Returns:
    {sap.suite.ui.commons.ComparisonData[]}
    getHeight(): sap.ui.core.CSSSize
    Getter for property height. Height of the chart.

    Default value is empty/undefined

    Since:
    1.25
    Returns:
    {sap.ui.core.CSSSize} the value of property height
    getScale(): string
    Getter for property scale. The scaling suffix.

    Default value is empty/undefined

    Returns:
    {string} the value of property scale
    getShrinkable(): boolean
    Getter for property shrinkable. If it is set to true, the height of the control is defined by its content.

    Default value is false

    Since:
    1.25
    Returns:
    {boolean} the value of property shrinkable
    Getter for property size. Updates the size of the chart. If not set then the default size is applied based on the device tile.

    Default value is Auto

    Returns:
    {sap.suite.ui.commons.InfoTileSize} the value of property size
    Getter for property view. The view of the chart. If not set, the Normal view is used by default.

    Default value is Normal

    Since:
    1.25
    Returns:
    {sap.suite.ui.commons.ComparisonChartView} the value of property view
    getWidth(): sap.ui.core.CSSSize
    Getter for property width. The width of the chart. If it is not set, the size of the control is defined by the size property.

    Default value is empty/undefined

    Since:
    1.22
    Returns:
    {sap.ui.core.CSSSize} the value of property width
    indexOfData(oData): int
    Checks for the provided sap.suite.ui.commons.ComparisonData in the aggregation named data and returns its index if found or -1 otherwise.
    Parameters:
    {sap.suite.ui.commons.ComparisonData}oData the data whose index is looked for.
    Returns:
    {int} the index of the provided control in the aggregation if found, or -1 otherwise
    insertData(oData, iIndex): sap.suite.ui.commons.ComparisonChart
    Inserts a data into the aggregation named data.
    Parameters:
    {sap.suite.ui.commons.ComparisonData}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.commons.ComparisonChart}this to allow method chaining
    Removes all the controls in the aggregation named data.
    Additionally unregisters them from the hosting UIArea.
    Returns:
    {sap.suite.ui.commons.ComparisonData[]} an array of the removed elements (might be empty)
    Removes an data from the aggregation named data.
    Parameters:
    {int|string|sap.suite.ui.commons.ComparisonData}vData the data to remove or its index or id
    Returns:
    {sap.suite.ui.commons.ComparisonData} the removed data or null
    setColorPalette(aColorPalette): sap.suite.ui.commons.ComparisonChart
    Setter for property colorPalette.

    Default value is []

    Parameters:
    {string[]}aColorPalette new value for property colorPalette
    Since:
    1.24
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining
    Setter for property height.

    Default value is empty/undefined

    Parameters:
    {sap.ui.core.CSSSize}sHeight new value for property height
    Since:
    1.25
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining
    Setter for property scale.

    Default value is empty/undefined

    Parameters:
    {string}sScale new value for property scale
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining
    setShrinkable(bShrinkable): sap.suite.ui.commons.ComparisonChart
    Setter for property shrinkable.

    Default value is false

    Parameters:
    {boolean}bShrinkable new value for property shrinkable
    Since:
    1.25
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining
    Setter for property size.

    Default value is Auto

    Parameters:
    {sap.suite.ui.commons.InfoTileSize}oSize new value for property size
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining
    Setter for property view.

    Default value is Normal

    Parameters:
    {sap.suite.ui.commons.ComparisonChartView}oView new value for property view
    Since:
    1.25
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining
    Setter for property width.

    Default value is empty/undefined

    Parameters:
    {sap.ui.core.CSSSize}sWidth new value for property width
    Since:
    1.22
    Returns:
    {sap.suite.ui.commons.ComparisonChart}this to allow method chaining