✆ UAE: +971 58 5616 616, ✆ USA:+14099168409,   ✉ info@insightcubes.com

Switch Themes in SAP Analytics Cloud

Enhance User Experience with Theme Switching in SAP Analytics Cloud

Switching between themes in SAP Analytics Cloud (SAC) Enhanced Stories offers unparalleled flexibility and customization for a more engaging data experience. By leveraging the power of Theme Builder and integrating JavaScript and CSS, users can seamlessly tailor their dashboards’ appearance to align with specific brand guidelines and aesthetic preferences. The Theme Builder simplifies the application of themes, enabling effortless changes to fonts, colors, and layouts, while the coding aspect provides granular control for advanced visual modifications.

This dual approach not only enhances storytelling by creating consistent, visually appealing reports but also significantly improves user engagement and readability across SAC stories. Optimizing themes elevates the user experience and strengthens alignment with corporate design standards. This method of blending system-based tools and custom code provides a powerful way to maximize SAC’s potential, whether for enhancing dashboard clarity or improving data presentation aesthetics, ultimately boosting both functionality and brand identity.

Switch between dark and light theme

Screenshot of a dark theme applied to an Enhanced Story in SAP Analytics Cloud, showcasing a visually appealing dashboard with contrasting colors, improved readability, and customized design elements that enhance user engagement.

The dark theme in enhanced Stories reduces eye strain in low-light settings while enhancing data visibility with high contrast. Its customizable elements support brand identity, improving user engagement and effective storytelling.

Screenshot of a light theme applied to an Enhanced Story in SAP Analytics Cloud, featuring a bright and clean dashboard design with vibrant colors, clear typography, and customized layout elements that enhance user experience and engagement.

The light theme in enhanced Stories offers a clear layout that enhances readability and data comprehension. Ideal for bright environments, it features customizable options that align with corporate branding for a professional presentation.

Create both themes and setup their preferences

set up the theme preferences in SAP Analytics Cloud

InsightCubes offers meticulously crafted dark and light themes tailored to achieve desired outcomes. These themes are designed to enhance user experience and engagement while aligning with specific project requirements.

Theme preferences setup in SAP analytics cloud

Upon developing both the dark and light themes, we proceed to implement JavaScript code that facilitates seamless switching between themes. Additionally, we enhance the visual appeal of specific widgets by integrating custom CSS, providing intricate design elements and details that enhance the overall aesthetic beyond the default theme offerings. This approach ensures a more engaging and tailored user experience.

Setting up the theme switch

Theme switch script variable SAP analytics cloud

Add a switch the story and create a Script Variable, we called it SV_Switch_GlobalTheme. Select Boolean for the Type and set the Default Value to True

Create a Script Objects and add a Script Function, name it “applyTheme”, and write the below code in its fx.

If your design and logo calls for adding two different colored logos depending on the background, you can incorporate the show and hide of each to fit the design needs in this step, as shown in the picture below, we added two arguments to switch the logos in all the story’s pages in one click. In the next step you will notice that we referenced the logos in the switch fx code, in other pages and since this is a script function, we reference the other added logos.

Example: var Logo_BS_Blue = Logo_LandingPage_Blue;

In the next story page, on its onActive fx, we would reference the Script Function and say it is equal to the name of the logos in the current page. This way the logos will switch to the correct one per page as soon as it is active.

Example: var Logo_BS_Blue = P2_Logo_BS_Blue;

onSwitch Script Objects

Write the code on the switch widget as shown in the image below

As seen in the image, we first referenced the Script Variable, then the logos, and then the Script Object and its Script Function. Note that if any Arguments are added to a Script Function, they have to be referenced where ever the Script Function is used.

Adding more details to the theme using CSS

Some widgets, like popups, have two ways to be added to the story; popups and story popups. In the theme builder only the background of the story popup can be specified in preferences. To be able to change design elements in the popup upon theme change we need to use some CSS magic.

We will be sharing a snippet from the Ownership dashboard for this section to demonstrate our approach.

We only used the .sap-custom-popup class name and background-color property to apply the needed change upon theme switch.

After writing the needed CSS, create a Script Variable with the type Popup and set as array

Call the Script Variable in the Pages’ onInitialize and list all the popups you want to be affected. Add the CSS class name you want to be the default, “ours is the dark” to each referenced popup’s class name. In our case it is the: “InsightCubesPopupBGDark” in their Styling CSS Class Name

Reference the PopupCssApply Script Variable in the applyTheme Script Objects.

Dark theme is the default on run time, and the switch will apply the light theme on first switch click and then dark theme upon second switch click.

Light theme upon first click on theme switch.

Recent Posts

Ownership interface of the consolidation solution for SAP analytics cloud

Managing Ownership Structure

Explore how Consolidation Extension for SAC simplifies managing ownership structures, spanning from creating and editing scopes to assigning ownership methods and percentages for accurate consolidation.

Systems Check and Referential Integrity Interface

Learn how SAP Analytics Cloud’s Consolidation Extension ensures data accuracy with system checks and referential integrity, ensuring proper configuration and identifying inconsistencies in design.

account configuration guide for the consolidation extension

Account Configuration Guide

Detailed guide with automated checks and inconsistencies identification on account configure for automated eliminations, cascading behavior, currency conversions and other rules

Configuration Starter Kit

Summary of all the features and automated system integrity rules included in identifying issues with designs covering scope, currency, account, audit, flow and other dimensions

Audit Trail Configuration Toolkit for the consolidation extension

Audit Trail Configuration Toolkit

A guided interface to help you configure the Audit Trail dimension and apply rules covering Copy opening, currency conversion, consolidation, staging, Journals, and others.

Get in Touch

Learn more and ask us About Our Cloud Consolidation Solution

Share This Post

Share this Page!

Share this with your network.

Want to Know More?

Get In Touch

Something isn’t Clear?


Feel free to contact us, and we will be more than happy to answer all of your questions.