A curated set of SAP Analytics Cloud (SAC) Custom Widgets built on top of the official community samples, extended with advanced configuration and UX features.
All code in this directory is provided under the PolyForm Noncommercial License 1.0.0. See the License section below.
- sunburst/
- Sunburst Chart (Advanced Tooltips) – ECharts sunburst with a powerful, configurable tooltip system (fields, formatting, styles).
- matrix_widget/
- Field Matrix (Configurable) – Table-like grid where each cell displays a dimension or KPI; supports per-cell filters and font styles.
- multi_half_donut/
- Multi Half Donut (up to 5 rings) – Concentric half-donuts, each bound to its own dimension/measure pair; per-ring palettes and label controls.
- stacked_bar_matrix/
- Stacked Bar Matrix – Grid of stacked bar charts, configurable legend location/formatting and value/percent labels.
- SAP Analytics Cloud tenant with Custom Widgets enabled.
- External CDN access for ECharts (cdnjs) or adapt to a hosted ECharts bundle.
- Data bindings: Each widget declares its own feeds (dimensions, measures) in
index.json.
- Zip the files inside each widget folder (the 3 files:
index.json,main.js,styling.js). - In SAC, go to Custom Widgets and import the ZIP.
- Add the widget to a story and bind the required data feeds.
- Open the Styling Panel to configure appearance and behavior.
Tip: If your environment doesn't have zip, use your OS archiving tool or PowerShell's Compress-Archive.
- Data Binding: 1 hierarchical Dimension + 1 Measure.
- Key Features:
- Tooltip fields array (label/key/prefix/suffix), reordering controls, header templates.
- Number formatting (decimals, prefix/suffix), tooltip text/bg/border styles.
- Optional synthetic root ("All") and color stops like the SAP sample.
- Styling Highlights:
- All/Label/Drill-up Colors; Tooltip Settings; Tooltip Fields add/remove/reorder.
- Data Binding: Dimensions + Measures.
- Key Features:
- Grid size (rows × cols), per-cell mapping to a measure or dimension key (e.g.,
measures_0,dimensions_0). - Optional per-mapping filters; global numeric formatting; tooltips list multiple values.
- Per-cell styles: font family/size/weight/style/color.
- Grid size (rows × cols), per-cell mapping to a measure or dimension key (e.g.,
- Styling Highlights:
- Editors for field mappings and per-cell styles; tooltip separator; show
*for multi-values.
- Editors for field mappings and per-cell styles; tooltip separator; show
- Data Binding: Dimensions + Measures.
- Key Features:
- Up to 5 rings; each ring has its own dimension/measure, palette, and label toggles.
- Global geometry (outer radius, thickness, spacing, centerY) and palette.
- Global and per-ring value/percent formatting (decimals, prefix/suffix); percentage corrected for half chart (×2).
- Styling Highlights:
- Ring editor with mapping/overrides; global format controls for values and percentages.
- Data Binding: Dimensions + Measures.
- Key Features:
- Matrix of stacked bar charts; per-cell mapping (dimension index + measure indices).
- Legend position (top/bottom/left/right), orientation, font size, color, item gap.
- Spacing controls: chart–legend spacing and cell gap.
- Labels: show values and/or percentages, with global formatting.
- Styling Highlights:
- Cell config editor; legend and label format controls.
A helper script is provided to generate Subresource Integrity (SRI) hashes for each widget’s index.json so SAC accepts the bundles in tenants that enforce integrity.
- Location:
sap_sac_custom_widgets/tools/generate_integrity.py - Purpose: computes SHA-256 SRI for each
webcomponents[].urlfile and writes it towebcomponents[].integrity. - It can also set
ignoreIntegrity=falsefor “production” imports.
Usage:
- Dry run (preview changes):
python3 sap_sac_custom_widgets/tools/generate_integrity.py --dry-run
- Generate hashes (preserve ignore flags):
python3 sap_sac_custom_widgets/tools/generate_integrity.py
- Enforce production integrity (turn off ignoreIntegrity):
python3 sap_sac_custom_widgets/tools/generate_integrity.py --enforce
- Custom root (if you moved folders):
python3 sap_sac_custom_widgets/tools/generate_integrity.py --root /path/to/widgets
Notes:
- Script skips
dist,.git,node_modules,__pycache__. - Works with
url(and oldersrc) fields inwebcomponents.
This work is licensed under the PolyForm Noncommercial License 1.0.0.
- You may use this software for noncommercial purposes only.
- Commercial use requires obtaining a separate commercial license from the author.
- Full license text: https://polyformproject.org/licenses/noncommercial/1.0.0/
- SPDX-Identifier: PolyForm-Noncommercial-1.0.0
By using or distributing this software, you agree to the terms of the PolyForm Noncommercial 1.0.0 license.
- Based on and inspired by SAP Analytics Cloud community samples.
- Charting via ECharts (Apache-2.0). Consider hosting your own ECharts build for production.