Abstract Class sap.gantt.legend.LegendBaseModule: sap/gantt/legend/LegendBase

extends Control
known direct subclasses: DimensionLegend, ListLegend

Base class for all legend template.

This base class defines basic properties for legend templates. sap.gantt provides two basic implementations of LegendBase:

  • sap.gantt.legend.ListLegend - A list legend template defines the representation of a list of legend items and their corresponding meanings
  • sap.gantt.legend.DimensionLegend - A dimension legend template defines the representation (shape, pattern, and color) of individual legend items and their corresponding meanings in both dimensions

Constructor Summary
new sap.gantt.legend.LegendBase(sId?, mSettings?)Creates and initializes a new Legend class.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.gantt.legend.LegendBase.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.gantt.legend.LegendBase with name sClassName and enriches it with the information contained in oClassInfo.
sap.gantt.legend.LegendBase.getMetadata()Returns a metadata object for class sap.gantt.legend.LegendBase.
getFontSize()Gets current value of property fontSize.
getLegendHeight()Gets current value of property legendHeight.
getLegendWidth()Gets current value of property legendWidth.
getSapUiSizeClass()Gets the value of the SAP UI size class.
getScaledLegendHeight()Gets the legend item height according to the SAP UI size class.
getScaledLegendWidth()Gets the legend item width according to the SAP UI size class.
getSvgDefs()Gets current value of property svgDefs.
setFontSize(sFontSize)Sets a new value for property fontSize.
setLegendHeight(sLegendHeight)Sets a new value for property legendHeight.
setLegendWidth(sLegendWidth)Sets a new value for property legendWidth.
setSvgDefs(sSvgDefs)Sets a new value for property svgDefs.
Constructor Detail
new sap.gantt.legend.LegendBase(sId?, mSettings?)
Creates and initializes a new Legend class.

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:

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

Parameters:
{string}sId? ID of the new control, generated automatically if no ID is given
{object}mSettings? Initial settings for the new control
Method Detail
sap.gantt.legend.LegendBase.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.gantt.legend.LegendBase 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.gantt.legend.LegendBase.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.gantt.legend.LegendBase.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
getFontSize(): number
Gets current value of property fontSize.

Font size of legend item texts.

Default value is 16.

Returns:
{number} Value of property fontSize
getLegendHeight(): number
Gets current value of property legendHeight.

Height of a legend item.

Default value is 32.

Returns:
{number} Value of property legendHeight
getLegendWidth(): number
Gets current value of property legendWidth.

Width of a legend item.

Default value is 32.

Returns:
{number} Value of property legendWidth
getSapUiSizeClass(): string
Gets the value of the SAP UI size class.
Returns:
{string} Value of the SAP UI size class.
getScaledLegendHeight(): string
Gets the legend item height according to the SAP UI size class.
Returns:
{string} Value of the legend item height.
getScaledLegendWidth(): string
Gets the legend item width according to the SAP UI size class.
Returns:
{string} Value of the legend item width.
getSvgDefs(): sap.gantt.def.SvgDefs
Gets current value of property svgDefs.

SVG reusable element definitions.

If this property is provided, the paint server definition of SVG is rendered. Method getDefString() should be implemented by all paint server classes that are passed to this property.

Returns:
{sap.gantt.def.SvgDefs} Value of property svgDefs
setFontSize(sFontSize): sap.gantt.legend.LegendBase
Sets a new value for property fontSize.

Font size of legend item texts.

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

Default value is 16.

Parameters:
{number}sFontSize New value for property fontSize
Returns:
{sap.gantt.legend.LegendBase} Reference to this in order to allow method chaining
setLegendHeight(sLegendHeight): sap.gantt.legend.LegendBase
Sets a new value for property legendHeight.

Height of a legend item.

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

Default value is 32.

Parameters:
{number}sLegendHeight New value for property legendHeight
Returns:
{sap.gantt.legend.LegendBase} Reference to this in order to allow method chaining
setLegendWidth(sLegendWidth): sap.gantt.legend.LegendBase
Sets a new value for property legendWidth.

Width of a legend item.

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

Default value is 32.

Parameters:
{number}sLegendWidth New value for property legendWidth
Returns:
{sap.gantt.legend.LegendBase} Reference to this in order to allow method chaining
setSvgDefs(sSvgDefs): sap.gantt.legend.LegendBase
Sets a new value for property svgDefs.

SVG reusable element definitions.

If this property is provided, the paint server definition of SVG is rendered. Method getDefString() should be implemented by all paint server classes that are passed to this property.

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

Parameters:
{sap.gantt.def.SvgDefs}sSvgDefs New value for property svgDefs
Returns:
{sap.gantt.legend.LegendBase} Reference to this in order to allow method chaining