Objective: Implement theme switching in SAP Analytics Cloud using an optimized approach.
Solution: It is possible to implement by using Optimised Design Experience (ODE).
Dashboard
These are the steps to achieve switching themes in SAP SAC.
Step 1:
Step 2:
It allows you to define plenty of styling options for each widget and is much easier to use than CSS.
Step 3:
Step 4:
Now in switch's fx onChange() , The script toggles between light and dark themes based on the current ThemeMode.
If the theme is dark:
theme selection
The script toggles between light and dark themes based on the current ThemeMode.
If the theme is dark:
Otherwise (theme is light):
This ensures dynamic theme and icon adjustments based on user interaction.
if ( ThemeMode === "dark" ) { ThemeMode = "light"; Application.setTheme("369CEA6B9DC57C13BF5FA65BB646871C"); DarkIcon.setVisible(false); LightIcon.setVisible(true); } else{ Application.setTheme("DE00DBCBBDA02C61A64EF48759CF3E43"); ThemeMode = "dark"; LightIcon.setVisible(false); DarkIcon.setVisible(true); } |
DarkIcon.setVisible(false); LightIcon.setVisible(true); if( Switch_2.isOn() === true){ DarkIcon.setVisible(true); LightIcon.setVisible(false); } else{ LightIcon.setVisible(true); DarkIcon.setVisible(false); } |
Don't forget to Save the story and view it!
Hurraayyyy successfully implemented the Light and Dark theme in SAP Analytics Cloud (SAC) 😎.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
9 | |
9 | |
7 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |