Class sap.viz.ui5.controls.VizFrameModule: sap/viz/ui5/controls/VizFrame

extends BaseControl

VizFrame is a viz control that manages a visualization’s initialization, layout, feeding, customization and interactions.

For more information on the available info chart types, see the following documentation.


Since: 1.22.0.
Constructor Summary
new sap.viz.ui5.controls.VizFrame(sId?, mSettings?)Constructor for a new ui5/controls/VizFrame.
Event Summary
deselectData(oControlEvent)Event fires when certain data point(s) is(are) deselected, data context of deselected item(s) would be passed in
renderComplete(oControlEvent)Event fires when the rendering ends.
selectData(oControlEvent)Event fires when certain data point(s) is(are) selected, data context of selected item(s) would be passed in.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.viz.ui5.controls.VizFrame.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.viz.ui5.controls.VizFrame with name sClassName and enriches it with the information contained in oClassInfo.
sap.viz.ui5.controls.VizFrame.getMetadata()Returns a metadata object for class sap.viz.ui5.controls.VizFrame.
addFeed(oFeed)Adds some feed to the aggregation feeds.
attachDeselectData(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the deselectData event of this sap.viz.ui5.controls.VizFrame.
attachRenderComplete(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the renderComplete event of this sap.viz.ui5.controls.VizFrame.
attachSelectData(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the selectData event of this sap.viz.ui5.controls.VizFrame.
destroyDataset()Destroys the dataset in the aggregation dataset.
destroyFeeds()Destroys all the feeds in the aggregation feeds.
detachDeselectData(fnFunction, oListener)Detaches event handler fnFunction from the deselectData event of this sap.viz.ui5.controls.VizFrame.
detachRenderComplete(fnFunction, oListener)Detaches event handler fnFunction from the renderComplete event of this sap.viz.ui5.controls.VizFrame.
detachSelectData(fnFunction, oListener)Detaches event handler fnFunction from the selectData event of this sap.viz.ui5.controls.VizFrame.
exportToSVGString(option?)Export the current viz as SVG String.
fireDeselectData(mArguments?)Fires event deselectData to attached listeners.
fireRenderComplete(mArguments?)Fires event renderComplete to attached listeners.
fireSelectData(mArguments?)Fires event selectData to attached listeners.
getDataset()Gets content of aggregation dataset.
getFeeds()Gets content of aggregation feeds.
getLegendVisible()Return current legend group visibility.
getVizCustomizations()Gets current value of property vizCustomizations.
getVizProperties()Gets current value of property vizProperties.
getVizScales()Gets current value of property vizScales.
getVizType()Gets current value of property vizType.
getVizUid()Uid for viz frame.
indexOfFeed(oFeed)Checks for the provided sap.viz.ui5.controls.common.feeds.FeedItem in the aggregation feeds.
insertFeed(oFeed, iIndex)Inserts a feed into the aggregation feeds.
removeAllFeeds()Removes all the controls from the aggregation feeds.
removeFeed(vFeed)Removes a feed from the aggregation feeds.
setDataset(oDataset)Sets the aggregated dataset.
setLegendVisible(bLegendVisible)Will respect the setting for all available legends.
setUiConfig(oUiConfig)Setter for property uiConfig.
setVizCustomizations(oVizCustomizations)Sets a new value for property vizCustomizations.
setVizProperties(oVizProperties)Properties for viz frame.
setVizScales(oVizScales)Scales for viz frame.
setVizType(sVizType)Setter for property vizType.
vizSelection(aPoints, oAction)Selections for viz frame.
vizUpdate(oOptions)Update viz frame according to a JSON object, it can update css, properties, feeds and data model.
zoom(contains)Zoom the chart plot.
getResponsiveLegend()Get ResponsiveLegend Control.
Constructor Detail
new sap.viz.ui5.controls.VizFrame(sId?, mSettings?)
Constructor for a new ui5/controls/VizFrame.

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
  • Aggregations
    • dataset : sap.viz.ui5.data.Dataset
    • feeds : sap.viz.ui5.controls.common.feeds.FeedItem[]
  • Events
    • renderComplete : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • selectData : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • deselectData : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.viz.ui5.controls.common.BaseControl 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
deselectData(oControlEvent)
Event fires when certain data point(s) is(are) deselected, data context of deselected item(s) would be passed in
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
renderComplete(oControlEvent)
Event fires when the rendering ends.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
selectData(oControlEvent)
Event fires when certain data point(s) is(are) selected, data context of selected item(s) would be passed in.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.viz.ui5.controls.VizFrame.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.viz.ui5.controls.VizFrame with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.viz.ui5.controls.common.BaseControl.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.viz.ui5.controls.VizFrame.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.viz.ui5.controls.VizFrame.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
Adds some feed to the aggregation feeds.
Parameters:
{sap.viz.ui5.controls.common.feeds.FeedItem}oFeed the feed to add; if empty, nothing is inserted
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
attachDeselectData(oData?, fnFunction, oListener?): sap.viz.ui5.controls.VizFrame
Attaches event handler fnFunction to the deselectData event of this sap.viz.ui5.controls.VizFrame.

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.viz.ui5.controls.VizFrame itself.

Event fires when certain data point(s) is(are) deselected, data context of deselected item(s) would be passed in

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.viz.ui5.controls.VizFrame itself
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
attachRenderComplete(oData?, fnFunction, oListener?): sap.viz.ui5.controls.VizFrame
Attaches event handler fnFunction to the renderComplete event of this sap.viz.ui5.controls.VizFrame.

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.viz.ui5.controls.VizFrame itself.

Event fires when the rendering ends.

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.viz.ui5.controls.VizFrame itself
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
attachSelectData(oData?, fnFunction, oListener?): sap.viz.ui5.controls.VizFrame
Attaches event handler fnFunction to the selectData event of this sap.viz.ui5.controls.VizFrame.

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.viz.ui5.controls.VizFrame itself.

Event fires when certain data point(s) is(are) selected, data context of selected item(s) would be passed in.

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.viz.ui5.controls.VizFrame itself
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
Destroys the dataset in the aggregation dataset.
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
Destroys all the feeds in the aggregation feeds.
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
detachDeselectData(fnFunction, oListener): sap.viz.ui5.controls.VizFrame
Detaches event handler fnFunction from the deselectData event of this sap.viz.ui5.controls.VizFrame.

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.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
detachRenderComplete(fnFunction, oListener): sap.viz.ui5.controls.VizFrame
Detaches event handler fnFunction from the renderComplete event of this sap.viz.ui5.controls.VizFrame.

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.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
detachSelectData(fnFunction, oListener): sap.viz.ui5.controls.VizFrame
Detaches event handler fnFunction from the selectData event of this sap.viz.ui5.controls.VizFrame.

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.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
exportToSVGString(option?): string
Export the current viz as SVG String. The viz is ready to be exported to svg ONLY after the initialization is finished. Any attempt to export to svg before that will result in an empty svg string.
Parameters:
{Object}option?
{
    width: Number - the exported svg will be scaled to the specific width.
    height: Number - the exported svg will be scaled to the specific height.
    hideTitleLegend: Boolean - flag to indicate if the exported svg includes the original title and legend.
    hideAxis: Boolean - flag to indicate if the exported svg includes the original axis.
}
Returns:
{string} the SVG string of the current viz or empty svg if error occurs.
fireDeselectData(mArguments?): sap.viz.ui5.controls.VizFrame
Fires event deselectData to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
fireRenderComplete(mArguments?): sap.viz.ui5.controls.VizFrame
Fires event renderComplete to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
fireSelectData(mArguments?): sap.viz.ui5.controls.VizFrame
Fires event selectData to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
Gets content of aggregation dataset.

Dataset for chart.

Returns:
{sap.viz.ui5.data.Dataset}
Gets content of aggregation feeds.

All feeds for chart.

Returns:
{sap.viz.ui5.controls.common.feeds.FeedItem[]}
getLegendVisible(): boolean
Return current legend group visibility.
Since:
1.28
Returns:
{boolean}
getVizCustomizations(): object
Gets current value of property vizCustomizations.

Chart customizations property, aim to customize existing (build-in) charts to meet specific LoB requirements. Currently, supported chart type : column, dual_column, bar, dual_bar, stacked_column, stacked_bar, 100_stacked_bar, 100_stacked_column, 100_dual_stacked_bar, 100_dual_stacked_column, dual_stacked_bar, dual_stacked_column, line, horizontal_line, dual_line, dual_horizontal_line, combination, horizontal_combination, stacked_combination, horizontal_stacked_combination, dual_stacked_combination, dual_horizontal_stacked_combination, scatter, bubble.

Returns:
{object} Value of property vizCustomizations
getVizProperties(): object
Gets current value of property vizProperties.

Chart properties, refer to chart property doc for more details.

Returns:
{object} Value of property vizProperties
getVizScales(): object
Gets current value of property vizScales.

Chart scales, refer to chart property doc for more details.

Since:
1.25
Returns:
{object} Value of property vizScales
getVizType(): string
Gets current value of property vizType.

Type for viz frame. User can pass 'chartType' or 'info/chartType'. For example both 'bar' and 'info/bar' will create a info bar chart. Supported chart type: column, dual_column, bar, dual_bar, stacked_bar, stacked_column, line, dual_line, combination, bullet, bubble, time_bubble, pie, donut, timeseries_column, timeseries_line, timeseries_scatter, timeseries_bubble, scatter, vertical_bullet, dual_stacked_bar, 100_stacked_bar, 100_dual_stacked_bar, dual_stacked_column, 100_stacked_column, 100_dual_stacked_column, stacked_combination, horizontal_stacked_combination, dual_stacked_combination, dual_horizontal_stacked_combination, heatmap, waterfall, horizontal_waterfall

Default value is column.

Returns:
{string} Value of property vizType
getVizUid(): string
Uid for viz frame. It supports other controls to connect to a viz instance.
Returns:
{string}
indexOfFeed(oFeed): int
Checks for the provided sap.viz.ui5.controls.common.feeds.FeedItem in the aggregation feeds. and returns its index if found or -1 otherwise.
Parameters:
{sap.viz.ui5.controls.common.feeds.FeedItem}oFeed The feed whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertFeed(oFeed, iIndex): sap.viz.ui5.controls.VizFrame
Inserts a feed into the aggregation feeds.
Parameters:
{sap.viz.ui5.controls.common.feeds.FeedItem}oFeed the feed to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the feed should be inserted at; for a negative value of iIndex, the feed is inserted at position 0; for a value greater than the current size of the aggregation, the feed is inserted at the last position
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
Removes all the controls from the aggregation feeds.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.viz.ui5.controls.common.feeds.FeedItem[]} An array of the removed elements (might be empty)
Removes a feed from the aggregation feeds.
Parameters:
{int|string|sap.viz.ui5.controls.common.feeds.FeedItem}vFeed The feedto remove or its index or id
Returns:
{sap.viz.ui5.controls.common.feeds.FeedItem} The removed feed or null
setDataset(oDataset): sap.viz.ui5.controls.VizFrame
Sets the aggregated dataset.
Parameters:
{sap.viz.ui5.data.Dataset}oDataset The dataset to set
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
setLegendVisible(bLegendVisible): object
Will respect the setting for all available legends.
Parameters:
{boolean}bLegendVisible Set legend visibility.
Since:
1.28
Returns:
{object}
setUiConfig(oUiConfig): sap.viz.ui5.controls.VizFrame
Setter for property uiConfig. uiConfig could only set via settings parameter of constructor.

uiConfig from base type could config the instance. Supported uiConfig keyword: applicationSet, showErrorMessage

Example:

var vizFrame = new sap.viz.ui5.controls.VizFrame({
 'vizType' : 'bar',
 'uiConfig' : {
     'applicationSet' : 'fiori',
     'showErrorMessage' : true
 }
});
Parameters:
{object}oUiConfig
Returns:
{sap.viz.ui5.controls.VizFrame}
setVizCustomizations(oVizCustomizations): sap.viz.ui5.controls.VizFrame
Sets a new value for property vizCustomizations.

Chart customizations property, aim to customize existing (build-in) charts to meet specific LoB requirements. Currently, supported chart type : column, dual_column, bar, dual_bar, stacked_column, stacked_bar, 100_stacked_bar, 100_stacked_column, 100_dual_stacked_bar, 100_dual_stacked_column, dual_stacked_bar, dual_stacked_column, line, horizontal_line, dual_line, dual_horizontal_line, combination, horizontal_combination, stacked_combination, horizontal_stacked_combination, dual_stacked_combination, dual_horizontal_stacked_combination, scatter, bubble.

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

Parameters:
{object}oVizCustomizations New value for property vizCustomizations
Returns:
{sap.viz.ui5.controls.VizFrame} Reference to this in order to allow method chaining
setVizProperties(oVizProperties): sap.viz.ui5.controls.VizFrame
Properties for viz frame.

Example:

 var vizFrame = new sap.viz.ui5.controls.VizFrame(...);
 var properties = {
     'legend' : { 'visible'; : true }
};
vizFrame.setVizProperties(properties);
Parameters:
{object}oVizProperties
Returns:
{sap.viz.ui5.controls.VizFrame}
setVizScales(oVizScales): sap.viz.ui5.controls.VizFrame
Scales for viz frame.

Example:

 var vizFrame = new sap.viz.ui5.controls.VizFrame(...);
 var scales = [{
     'feed': 'color',
     'palette': ['#ff0000']
}];
vizFrame.setVizScales(scales);
Parameters:
{object}oVizScales
Returns:
{sap.viz.ui5.controls.VizFrame}
setVizType(sVizType): sap.viz.ui5.controls.VizFrame
Setter for property vizType. vizType could only set via settings parameter in Constructor. Do not set vizType at runtime.

vizType is a string of supported chart type or extension chart type.

Supported chart types: bubble, combination, column, bar, line, stacked_bar, stacked_column, bullet, vertical_bullet, timebubble. User can pass 'chartType' or 'info/chartType' for these supported chart types.

Example:

var vizFrame = new sap.viz.ui5.controls.VizFrame({
 'vizType' : 'bar'
});

For extension chart type, user should load extension js file manually at first.

Example:

var vizFrame = new sap.viz.ui5.controls.VizFrame({
 'vizType' : 'myextension'
});
Parameters:
{string}sVizType
Returns:
{sap.viz.ui5.controls.VizFrame}
vizSelection(aPoints, oAction): sap.viz.ui5.controls.VizFrame
Selections for viz frame. Example:

 var vizFrame = new sap.viz.ui5.controls.VizFrame(...);
 var points = [{
     data : {
         "Country" : "China",
         "Year" : "2001",
         "Product" : "Car",
         "Profit" : 25
     }}, {
     data : {
         "Country" : "China",
         "Year" : "2001",
         "Product" : "Trunk",
         "Profit" : 34
     }}];
 var action = {
     clearSelection : true
 };
vizFrame.vizSelection(points, action);
Parameters:
{object[]}aPoints some data points of the chart
{object}oAction whether to clear previous selection, by default the selection will be incremental selection
Returns:
{sap.viz.ui5.controls.VizFrame}
vizUpdate(oOptions): sap.viz.ui5.controls.VizFrame
Update viz frame according to a JSON object, it can update css, properties, feeds and data model. Example:

var vizFrame = new sap.viz.ui5.controls.VizFrame(...);
var data = new  sap.viz.ui5.data.FlattenedDataset(...);
var properties = {
    'legend' : {'visible' : true},
};
var scales = [{
     'feed': 'color',
     'palette': ['#ff0000']
}];
var customizations = {id:"sap.viz.custom",customOverlayProperties: {}};
var FeedItem = sap.viz.ui5.controls.common.feeds.FeedItem;
var feeds = [
    new FeedItem({'uid' : 'primaryValues',
                  'type' : 'Measure',
                  'values' []}),
    new FeedItem({'uid' : 'regionColor',
                  'type' : 'Dimension',
                  'values' []})];
vizFrame.vizUpdate({
              'data' : data,
              'properties' : properties,
              'scales' : scales,
              'customizations' : customizations,
              'feeds' : feeds
          });
Parameters:
{object}oOptions a JSON object contains combination of properties, feeds and data model.
Returns:
{sap.viz.ui5.controls.VizFrame}
zoom(contains)
Zoom the chart plot.

Example:

 var vizFrame = new sap.viz.ui5.controls.VizFrame(...);
 vizFrame.zoom({direction: "in"});
Parameters:
{object}contains a "direction" attribute with value "in" or "out" indicating zoom to enlarge or shrink respectively
getResponsiveLegend(): void
Get ResponsiveLegend Control. (For fiori application set only. It has been deprecated since 1.28.)
Deprecated:
Since version 1.28. This API has been deprecated. This interface will be removed from the SAPUI5 delivery in one of the next releases.