Analytical Card

Analytical Card displays business data visualized in different charts.

The charts are rendered with the sap.viz library, which is part of SAPUI5 distribution and is not available in OpenUI5.

In the card manifest charts are defined by the chartType, measures, dimensions and feeds properties. These properties and their values are derived from and follow the sap.viz charting library definitions. With the optional chartProperties property charts can be customized with all the options from the VizDocs. Samples of the sap.viz library can be found here.

Usage

Properties

The Analytical Card contains a chart visualization configuration

Property Type Default Value Required Description Schema Version Since
chartType string Yes The type of the chart, for example "stacked_column", "bar", "donut". The full list of supported types can be found in the VizDocs. Values "Line", "StackedBar", "StackedColumn" and "Donut" are also allowed, but deprecated. 1.14.0 1.62
chartProperties object No Configuration for the chart. Different chart types have different configurations. For each type see its "Properties" documentation in the VizDocs.
Note: This property is experimental and may change!
Note: Some properties might require additional coding, which should be implemented by the card developer.
Note: Some values are set by default by the card.
Note: Functions are not supported.
1.36.0 1.95
measures Measure[] Yes Definitions of all measures in the dataset. 1.14.0 1.62
dimensions Dimension[] Yes Definitions of all dimensions in the dataset. 1.14.0 1.62
feeds FeedItem[] Yes Feeds for the chart.
Note: This property is experimental and may change!
1.36.0 1.95
minHeight sap.ui.core.CSSSize 14rem No Defines the minimum height of the chart. 1.16.0 1.85
actions Actions[] No Actions that are triggered when the content area is pressed. To trigger actions only by pressing the chart points set the actionableArea property. 1.15.0 1.65
actionableArea string "Full" No Defines which parts of the content are interactive. Possible values are:
  • "Full" - pressing anywhere in the content will trigger the defined actions
  • "Chart" - only pressing over the parts of the chart will trigger the defined actions
Note: This property is experimental and may change!
Note: When actionableArea has value Full, the property actions must match completely the property actions on the card header, since only the card header action is assigned as the default card action when using keyboard.
Note: When actionableArea has value Full, and the property actions is used to make the full content interactive, the content itself must not contain interactive elements. It is not recommended to nest interactive elements in this scenario.
1.34.0 1.92
popover Popover No Configuration for a popover, which will open while pressing chart points.
Note: This property is experimental and may change!
1.34.0 1.92

Deprecated properties

Property Type Default Value Required Description Schema Version Since
legend Legend No This property is deprecated. Use chartProperties instead.
Configuration for the legend.
1.14.0 1.62
plotArea PlotArea No This property is deprecated. Use chartProperties instead.
Plot configuration.
1.14.0 1.62
title Title No This property is deprecated. Use chartProperties instead.
Configuration for the title of the chart.
1.14.0 1.62
measureAxis string Yes This property is deprecated. Use feeds instead.
Represents the value set for the measure axis.
1.14.0 1.62
dimensionAxis string Yes This property is deprecated. Use feeds instead.
Represents the value set for the dimension axis.
1.14.0 1.62
Dimension Properties
Property Type Required Description Schema Version Since
value string Yes Value of the field. 1.14.0 1.62
displayValue string No Display value for the dimension. It doesn't work with 'waterfallType' 1.43.0 1.102
dataType string No Data type of the dimension as displayed in the chart. Possible values are "string", "number" or "date". 1.45.0 1.103
name string Yes A name of the dimension. It should be referenced later in the feeds. 1.36.0 1.95

Deprecated properties

Property Type Required Description Schema Version Since
label string Yes This property is deprecated. Use name instead.
Name of the dimension. This value will be used as label for the corresponding axis.
1.14.0 1.62
Measure Properties
Property Type Required Description Schema Version Since
value string Yes Value of the field. 1.14.0 1.62
name string Yes A name of the measure. It should be referenced later in the feeds. 1.36.0 1.95

Deprecated properties

Property Type Required Description Schema Version Since
label string Yes This property is deprecated. Use name instead.
Name of the measure. This value will be used as label for the corresponding axis.
1.14.0 1.62
FeedItem Properties
Property Type Required Description Schema Version Since
type string Yes The type of the feed. Either "Measure" or "Dimension" 1.36.0 1.95
uid string Yes The uid instructs the charting library what this feed is used for. It can be different for the different chart types. For example for "donut" chart it can be used for color or size by setting the uid to "color" or "size" respectively. For each chart type see the section "Bindings" in the VizDocs. 1.36.0 1.95
values string[] Yes The names of the measures or dimensions that are used for this feed. 1.36.0 1.95
Popover Properties
Property Type Default Value Required Description Schema Version Since
active boolean false No Whether the popover is active. If it's not it won't open.
Note: If there are actions attached, they will take precedence over the opening of the popover.
1.34.0 1.92
actionsStrip actionStripItem[] No The action item that is rendered as an action button in the popover.
Note: Only a single item is supported.
Note: This property is experimental and may change!
1.62.0 1.122
Popover Action Strip Item Properties (Experimental)
Property Type Default Value Required Description Schema Version Since
text string No The text of the action button 1.62.0 1.122
actions actions[] No The action that is triggered when the action button is pressed. 1.62.0 1.122

Deprecated Properties

Legend Properties
Property Type Default Value Required Description Schema Version Since
visible boolean true No Visibility of the legend. 1.14.0 1.62
position string "Right" No The position of the legend. Possible values are "Top", "Bottom", "Left" and "Right" 1.14.0 1.62
alignment string "TopLeft No Defines how the how the legend will be aligned. Possible values are "TopLeft" and "Center" 1.14.0 1.62
PlotArea Properties
Property Type Default Value Required Description Schema Version Since
dataLabel DataLabel No 1.14.0 1.62
categoryAxisText AxisText No Configuration of the text for the category axis. 1.14.0 1.62
valueAxisText AxisText No Configuration of the text for the value axis. 1.14.0 1.62
DataLabel Properties
Property Type Default Value Required Description Schema Version Since
visible boolean false No Visibility of the data labels. 1.14.0 1.62
showTotal boolean false No Visibility of data label for total value in some charts. 1.14.0 1.62
AxisText Properties
Property Type Default Value Required Description Schema Version Since
visible boolean true No Visibility of axis text. 1.14.0 1.62
Title Properties
Property Type Default Value Required Description Schema Version Since
visible boolean true No Visibility of the title. 1.14.0 1.62
text string No Title text. 1.14.0 1.62
alignment string "Center No The position of the title. Possible values are "Left", "Center" and "Right". 1.14.0 1.62

Example

Define the type and data for the card:

{
	"sap.card": {
		"type": "Analytical",
		"header": {},
		"content": {}
	}
}

Define the header of the card:

{
	"header": {
		"type": "Numeric",
		"data": {
			"json": {
				"n": "56",
				"u": "%",
				"trend": "Up",
				"valueColor": "Good"
			}
		},
		"title": "Project Cloud Transformation",
		"subTitle": "Forecasted goal achievement depending on business logic and other important information",
		"unitOfMeasurement": "EUR",
		"mainIndicator": {
			"number": "{n}",
			"unit": "{u}",
			"trend": "{trend}",
			"state": "{valueColor}"
		},
		"details": "Project Cloud Transformation details and additional information",
		"sideIndicators": [
			{
				"title": "Long title",
				"number": "3252.234",
				"unit": "K"
			},
			{
				"title": "Long Deviation Long Deviation",
				"number": "22.43",
				"unit": "%"
			}
		]
	}
}

Define the content of the card:

"content": {
	"chartType": "stacked_column",
	"chartProperties": {
		"legend": {
			"visible": false
		},
		"plotArea": {
			"dataLabel": {
				"visible": false,
				"showTotal": true
			}
		},
		"title": {
			"text": "Stacked column chart",
			"alignment": "bottom"
		}
	},
	"data": {
		"request": {
			"url": "./cardcontent/revenue.json"
		},
		"path": "/list"
	},
	"dimensions": [
		{
			"name": "Weeks",
			"value": "{Week}"
		}
	],
	"measures": [
		{
			"name": "Revenue",
			"value": "{Revenue}"
		},
		{
			"name": "Cost",
			"value": "{Cost}"
		}
	],
	"feeds": [
		{
			"type": "Dimension",
			"uid": "categoryAxis",
			"values": [
				"Weeks"
			]
		},
		{
			"type": "Measure",
			"uid": "valueAxis",
			"values": [
				"Revenue",
				"Cost"
			]
		}
	]
}

The content of the revenue.json which we are requesting:

"list": [
	{
	  "Week": "CW14",
	  "Revenue": 431000.22,
	  "Cost": 230000.00,
	  "Cost1": 24800.63,
	  "Cost2": 205199.37,
	  "Cost3": 199999.37,
	  "Target": 500000.00,
	  "Budget": 210000.00
	},
	{
	  "Week": "CW15",
	  "Revenue": 494000.30,
	  "Cost": 238000.00,
	  "Cost1": 99200.39,
	  "Cost2": 138799.61,
	  "Cost3": 200199.37,
	  "Target": 500000.00,
	  "Budget": 224000.00
	},
	{
	  "Week": "CW16",
	  "Revenue": 491000.17,
	  "Cost": 221000.00,
	  "Cost1": 70200.54,
	  "Cost2": 150799.46,
	  "Cost3": 80799.46,
	  "Target": 500000.00,
	  "Budget": 238000.00
	},
	{
	  "Week": "CW17",
	  "Revenue": 536000.34,
	  "Cost": 280000.00,
	  "Cost1": 158800.73,
	  "Cost2": 121199.27,
	  "Cost3": 108800.46,
	  "Target": 500000.00,
	  "Budget": 252000.00
	},
	{
	  "Week": "CW18",
	  "Revenue": 675000.00,
	  "Cost": 230000.00,
	  "Cost1": 140000.91,
	  "Cost2": 89999.09,
	  "Cost3": 100099.09,
	  "Target": 600000.00,
	  "Budget": 266000.00
	},
	{
	  "Week": "CW19",
	  "Revenue": 680000.00,
	  "Cost": 250000.00,
	  "Cost1": 172800.15,
	  "Cost2": 77199.85,
	  "Cost3": 57199.85,
	  "Target": 600000.00,
	  "Budget": 280000.00
	},
	{
	  "Week": "CW20",
	  "Revenue": 659000.14,
	  "Cost": 325000.00,
	  "Cost1": 237200.74,
	  "Cost2": 87799.26,
	  "Cost3": 187799.26,
	  "Target": 600000.00,
	  "Budget": 294000.00
	}
]

Create the view to display the card:

<mvc:View xmlns:w="sap.ui.integration.widgets">
	<w:Card manifest="./manifest.json" width="400px" height="auto"/>
</mvc:View>
Try it Out