SAC1
SAC1
Public
Warning
This document has been generated from SAP Help Portal and is an incomplete version of the official SAP product documentation.
The information included in custom documentation may not reflect the arrangement of topics in SAP Help Portal, and may be
missing important aspects and/or correlations to other topics. For this reason, it is not for production use.
This is custom documentation. For more information, please visit SAP Help Portal. 1
2/9/25, 4:40 PM
You can define the widget add-on using JavaScript in a contribution JSON file. Here's the sample code:
Sample Code
{
"id": "com.demo.localVizAddOns",
"version": "1.0.0",
"name": "Widget Customization Local Add-on",
"description": "A widget customization add-on demo",
"icon": "undefined",
"vendor": "Demo",
"eula": "EULA",
"license": "1.0",
"extensions": [
{
"extensionPoint": "sap.addOn.viz.tooltip",
"webcomponents": [
{
"kind": "main",
"tag": "viz-tooltip",
"url": "http://localhost:8088/viz-tooltip.js",
"integrity": "",
"ignoreIntegrity": true
},
{
"kind": "builder",
"tag": "viz-tooltip-build",
"url": "http://localhost:8088/viz-tooltip-builder-panel.js",
"integrity": "",
"ignoreIntegrity": true
}
],
"properties": {
"max": {
"type": "number",
"description": "The max of range value",
"default": "100"
},
"color": {
"type": "string",
"description": "Text Color info",
"default": "lightblue"
}
}
},
{
"extensionPoint": "sap.addOn.viz.plotarea.barColumn",
This is custom documentation. For more information, please visit SAP Help Portal. 2
2/9/25, 4:40 PM
"webcomponents": [
{
"kind": "main",
"tag": "viz-overlay",
"url": "http://localhost:8088/viz-plotarea.js",
"integrity": "",
"ignoreIntegrity": true
},
{
"kind": "builder",
"tag": "viz-plotarea-build",
"url": "http://localhost:8088/viz-plotarea-builder-panel.js",
"integrity": "",
"ignoreIntegrity": true
}
],
"properties": {
"sapHideOriginalDataPointMarks": {
"type": "boolean",
"default": true
},
"sapHideOriginalDataPointLabels": {
"type": "boolean",
"default": true
},
"sapHideOriginalXAxisLabels": {
"type": "boolean",
"default": true
},
"sapHideOriginalYAxisLabels": {
"type": "boolean",
"default": true
},
"sapHideOriginalXAxisStackLabels": {
"type": "boolean",
"default": true
},
"sapHideOriginalYAxisStackLabels": {
"type": "boolean",
"default": true
},
"sapHideOriginalLegendLabels": {
"type": "boolean",
"default": true
},
"sapHideOriginalLegendSymbols": {
"type": "boolean",
"default": true
},
"sapHideOriginalLegendLines": {
"type": "boolean",
"default": true
},
"rounded": {
This is custom documentation. For more information, please visit SAP Help Portal. 3
2/9/25, 4:40 PM
"type": "boolean",
"description": "Should bar/column be rounded",
"default": true
},
"sizeIncrement": {
"type": "number",
"description": "The increment rate of bar/column size",
"default": 0
},
"axisLabelColor": {
"type": "string",
"description": "The chart axis label color",
"default": "#fff"
}
}
},
{
"extensionPoint": "sap.addOn.viz.plotarea.numericPoint",
"webcomponents": [
{
"kind": "main",
"tag": "viz-metric-plotarea",
"url": "http://localhost:8088/viz-metric-plotarea.js",
"integrity": "",
"ignoreIntegrity": true
},
{
"kind": "builder",
"tag": "viz-metric-plotarea-build",
"url": "http://localhost:8088/viz-metric-plotarea-build.js",
"integrity": "",
"ignoreIntegrity": true
}
],
"properties": {
"sapHideOriginalPrimaryNumber": {
"type": "boolean",
"default": true
},
"sapHideOriginalPrimaryLabel": {
"type": "boolean",
"default": true
},
"sapHideOriginalSecondaryNumber": {
"type": "boolean",
"default": true
},
"sapHideOriginalSecondaryLabel": {
"type": "boolean",
"default": true
},
"labelColor": {
"type": "string",
"description": "The chart axis label color",
This is custom documentation. For more information, please visit SAP Help Portal. 4
2/9/25, 4:40 PM
"default": "red"
},
"numberColor": {
"type": "string",
"description": "The chart axis number color",
"default": "green"
},
"max": {
"type": "number",
"description": "The max of range value",
"default": "100"
}
}
}
]
}
The JSON file format of a custom add-on is similar to that of a custom widget. The difference mainly lies in the extensions node,
which is an array of add-on specifications comprising of extension point, web components, properties and reserved settings. Refer
to the following sections for more information about them.
Extension Point
The extension points are exposed by SAP Analytics Cloud custom add-ons framework to developers. extensionPoint specifies
the part of built-in widget to be extended or replaced by webcomponents defined in extensions.
sap.addOn.viz.tooltip
sap.addOn.viz.plotarea.general
sap.addOn.viz.plotarea.numericPoint
Web Components
Similar to custom widgets, the extensions of custom add-ons are also implemented as web components. However, there're two
major differences:
1. Web components defined in custom add-ons are to add or replace parts of a built-in widget, instead of creating a new
widget;
2. There're only two types of web components for each custom add-on: one is main component, and the other is builder panel
component. There's no styling panel component.
Properties
Similar to custom widgets, the properties of the custom add-ons can be defined.
Reserved Settings
Different from the properties defined in custom widgets, there're pre-defined property settings for custom add-ons that change
the behavior or appearance of the built-in widget to better display or improve the extension. For example, the plot area extension is
This is custom documentation. For more information, please visit SAP Help Portal. 5
2/9/25, 4:40 PM
displayed as an overlay over the original chart. To have better visual effects, you can choose to hide data point markers, data point
labels or axis labels on original chart so that the the ones provided by extension won't overlap with original ones.
The reserved settings can be defined directly in properties node, but its name and type must follow the API reference.
API Reference
Look up APIs related to custom add-ons.
IAddOnComponent
To make the communication between custom extensions and SAP Analytics Cloud framework possible, and also to manage the
custom extension's lifecycle, the custom component provided in add-on extension should extend following interface:
Code Syntax
/**
* Called before the custom settings properties changed.
* @param {Object} changedProps The changed settings properties of this custom element;
*/
onBeforeUpdate?(changedProps: any): void;
/**
* Called after the custom settings properties changed.
* @param {Object} changedProps The changed settings properties of this custom element;
*/
onAfterUpdate?(changedProps: any): void;
}
IVizTooltipExtensionData
Code Syntax
/**
* Interface to describe a row displayed on chart tooltip
*/
export interface IVizTooltipRow {
/**
* The title of the row
*/
title: string;
/**
* The value of the row
*/
value: string;
This is custom documentation. For more information, please visit SAP Help Portal. 6
2/9/25, 4:40 PM
/**
* The key of the row
*/
key?: string;
}
/**
* Interface of chart tooltip extension data
*/
export interface IVizTooltipExtensionData {
/**
* The header row data of chart tooltip
*/
header: IVizTooltipHeaderRow;
/**
* The details rows data of chart tooltip
*/
details: IVizTooltipRow[];
}
Code Syntax
export interface ISize {
width: number;
height: number;
}
/**
This is custom documentation. For more information, please visit SAP Help Portal. 7
2/9/25, 4:40 PM
* Defines CSS properties of a rect.
*/
export interface IRectStyles {
/**
* The font family to use for the text.
* e.g., "Arial", "Helvetica", "Times New Roman"
*/
fontFamily?: string;
/**
* The font style to apply.
* e.g., "normal", "italic", "oblique"
*/
fontStyle?: string;
/**
* The font weight (thickness).
* e.g., "normal", "bold", "bolder", "lighter",
* or numeric values (100-900)
*/
fontWeight?: string;
/**
* Text decoration to add.
* e.g., "none", "underline", "overline",
* "line-through"
*/
textDecoration?: string;
/**
* Text shadow effect.
* Format: "h-shadow v-shadow blur color"
* e.g., "2px 2px 5px rgba(0, 0, 0, 0.5)" for
* a semi-transparent black shadow
*/
textShadow?: string;
};
interface ISeries {
/**
* The layout information of data points in current series
*/
dataPoints: IDataPoint;
/**
* If current series is selected
*/
selected: boolean;
/**
* The name of the series;
*/
name: string;
/**
* The color of the data point marks in current series.
* In the format of either "[css_color]" or "[pattern_id] [css_color]".
* eg. "#CCCCCC" or "hatch2 #CCCCCC"
* The pattern_id has no significance to developers.
*/
color: string;
/**
* If Show-as Triangle is enabled on current series
*/
showAsTriangle?: boolean;
/**
* The layout information of the legend item in current series
*/
legendInfo?: ILegendInfo;
}
interface IDataPoint {
/**
* Provide data mark layout information of current data point;
*/
dataInfo: IDataInfo;
/**
* Provide data label layout information of current data point;
*/
labelInfo: ILabelInfo;
}
This is custom documentation. For more information, please visit SAP Help Portal. 8
2/9/25, 4:40 PM
interface ILegendInfo {
/**
* The layout information of the legend label.
*/
label?: ILegendLabel;
/**
* The layout information of the legend symbol.
*/
symbol?: IRect;
/**
* The layout information of the legend line.
*/
line?: IRect;
}
This is custom documentation. For more information, please visit SAP Help Portal. 9
2/9/25, 4:40 PM
* If true, it's a bar chart, otherwise it's a column chart
*/
isHorizontal: boolean;
/**
* The view range of current chart. It should be applied to
* custom add-on component's clip-path style so that the
* elements (data points, labels) out of view range are not
* displayed.
*/
clipPath: IRect;
/**
* The series of the chart
*/
series: ISeries[];
/**
* The layout information of x-aixs labels
*/
xAxisLabels?: IAxisLabel[];
/**
* The layout information of y-axis labels
*/
yAxisLabels?: IAxisLabel[];
/**
* The layout information of x-aixs stacked labels
*/
xAxisStackLabels?: IAxisLabel[];
/**
* The layout information of y-aixs stacked labels
*/
yAxisStackLabels?: IAxisLabel[];
/**
* The layout information of the whole container of legends
*/
legendContainer?: ILegendContainer;
}
Code Syntax
export const AddOnsReservedSettings = {
['sap.addOn.viz.plotarea.general']: {
['sapHideOriginalDataPointMarks']: {
'type': 'boolean',
'description': 'If the data point marks should be hidden on original chart',
'default': false
},
['sapHideOriginalDataPointLabels']: {
'type': 'boolean',
'description': 'If the data point labels should be hidden on original chart',
'default': false
},
['sapHideOriginalXAxisLabels']: {
'type': 'boolean',
'description': 'If the x-axis labels should be hidden on original chart',
'default': false
},
['sapHideOriginalYAxisLabels']: {
'type': 'boolean',
'description': 'If the y-axis labels should be hidden on original chart',
'default': false
},
['sapHideOriginalXAxisStackLabels']: {
'type': 'boolean',
'description': 'If the stack labels on x-axis should be hidden on original chart',
'default': false
},
['sapHideOriginalYAxisStackLabels']: {
'type': 'boolean',
'description': 'If the stack labels on y-axis should be hidden on original chart',
'default': false
},
['sapHideOriginalLegendLabels']: {
'type': 'boolean',
This is custom documentation. For more information, please visit SAP Help Portal. 10
2/9/25, 4:40 PM
'description': 'If the legend labels should be hidden on original chart',
'default': false
},
['sapHideOriginalLegendSymbols']: {
'type': 'boolean',
'description': 'If the legend symbols should be hidden on original chart',
'default': false
},
['sapHideOriginalLegendLines']: {
'type': 'boolean',
'description': 'If the legend lines should be hidden on original chart',
'default': false
},
},
};
Code Syntax
interface INumber extends ILabelRect {
pointValue: string | undefined;
}
interface IRow {
/**
* The layout information of row number
*/
number: INumber;
/**
* The layout information of row label
*/
label: ILabel;
}
Code Syntax
export const AddOnsReservedSettings = {
['sap.addOn.viz.plotarea.numericPoint']: {
['sapHideOriginalPrimaryNumber']: {
'type': 'boolean',
'description': 'If the numbers of primary values should be hidden on original chart'
'default': false
},
['sapHideOriginalPrimaryLabel']: {
'type': 'boolean',
'description': 'If the labels of primary values should be hidden on original chart',
'default': false
},
This is custom documentation. For more information, please visit SAP Help Portal. 11
2/9/25, 4:40 PM
['sapHideOriginalSecondaryNumber']: {
'type': 'boolean',
'description': 'If the numbers of secondary values should be hidden on original char
'default': false
},
['sapHideOriginalSecondaryLabel']: {
'type': 'boolean',
'description': 'If the labels of secondary values should be hidden on original chart
'default': false
}
},
};
This is custom documentation. For more information, please visit SAP Help Portal. 12