Forum Discussion
AssafHanina
07-28-2025Sisense Employee
Hey BalaR​ ,
Changing the color of the entire dashboard is possible, but it doesn't need to be done from every widget.
The goal is to trigger an alert whenever the metric falls below 100, even if the user can't visibly see the value.
The following can be achieved with few ways, here is an example:
- Using Widget script that check for the Threshold (smaller than 100) and apply the style for the dashboard layout as describe here
- Using Widget script to pop up an Alert while the value reach to the Threshold - Optional approach
Here is the example for threshold less than 5,000.
Widget script - to be added into the Gauge widget
const helloMessage = "Revenue is lower than 5000 usd";
const threshold = 5000;
widget.on("processresult", function(widget, result) {
const resultValue = result.result.value.data;
console.log("Widget result value:", resultValue);
if (resultValue < threshold) {
// Optional: Show the hello message
alert(helloMessage);
// Apply styling to dashboard layout
$('.dashboard-layout-column').css('background-color', '#000000');
$('.dashboard-layout-subcell-host').css('padding', '10px');
}
else {
// set to default layout
$('.dashboard-layout-column').css('background-color', '#ffffff');
$('.dashboard-layout-subcell-host').css('padding', '0px');
}
});
Initial dashboard - Gauge with Single value for threshold set up
Dashboard Layout after
Alert pop up - optional:
Disclaimer: This is a sample solution designed for a specific use case. It may require customization to fit different scenarios or requirements.
fyi DRay​