Forum Discussion

BalaR's avatar
BalaR
Data Storage
07-18-2025

Change colour of the entire report if the base size goes below a certain value

We usually have the base value in one of the widgets, which could be on the top or bottom of the report and I like the conditional formatting feature to the base size widget to change to a different colour when the sample size based on selection is below a certain value e.g. <100/ <30. We use this to warn the user that the base size is too low to infer with confidence. However, if the report is long then the base size widget warning condition can go amiss as it is setup on the top of the report. Is there a way to apply conditional formatting to the entire report if the base size widget goes below a certain value? in other words, is there a way to change the colour of the entire report if based on the selections the base size is lower than a value? 

6 Replies

  • AssafHanina's avatar
    AssafHanina
    Sisense 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:

    1. Using Widget script that check for the Threshold (smaller than 100) and apply the style for the dashboard layout as describe here
    2. 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​ 

     

  • DRay's avatar
    DRay
    Sisense Employee

    Hi BalaR​,

    I’m following up to see if the solution offered by AssafHanina​ worked for you.

    If so, please click the 'Accept as Solution' button on their post. That way others with the same questions can find the answer. If not, please let us know so that we can continue to help.

    Thank you.

  • DRay's avatar
    DRay
    Sisense Employee

    Hi BalaR​,

    Thank you for reaching out.

    Here are a few posts that may help.

    Change background and font color of widgets in Sisense

    Highlight Bars with Above/Below Average Values in a Column Chart

    Set The Background Color Of An Indicator

    Highlight Max and Min values in Line chart

    Using a combination of the conditional formatting and background customization, you should be able to change the Widget background dynamically. 

    If that doesn't help, I have a few questions that will help us determine the best way forward for you.

    1. What kind of report widget are you using?
    2. Do you want the background of an individual Widget to change, or the background an entire Dashboard with multiple Widgets on it?
  • BalaR's avatar
    BalaR
    Data Storage

    Hi DRay! 

    Apologies for the slow response, could not access the discussion for the last 2 days, was getting a 404 error. Seems to have fixed itself. My report has many widgets, one of the widgets is a numeric gauge card to show sample size achieved. I have successfully applied a conditional format so if based on the selections/ filters the value in sample size card is below 100 the card turns red. But I would like the entire report to turn a different colour if the sample size is below 100. The idea is that if the stakeholder is trying to infer something in the report by selecting a few filters and the sample size is below 100 it serves as a warning/ caution. The reason why applying this rule to the entire report is important is that if the viewer keeps scrolling and selecting filters, they won't know that the sample/ base size is low. Is there a way to apply conditional formatting to the entire report based on the value on one visulisation?  

    • DRay's avatar
      DRay
      Sisense Employee

      Hi BalaR​,

      I don't know how personally, but if someone in the community doesn't provide a solution I can connect you with a technical resource who can help.

  • DRay's avatar
    DRay
    Sisense Employee

    Hi BalaR​,

    I know it's been a while, but I wanted to check in to see if you still need help with this.