<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Dynamic Threshold-Based Background Color for SAC Nume... in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/dynamic-threshold-based-background-color-for-sac-numeric-point/qaa-p/14260105#M4930908</link>
    <description>&lt;P&gt;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1565995"&gt;@Fiona_&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May be you could explore using CSS in scripting.&amp;nbsp; You can use setcssclass method with an IF condition checking your threshold criteria.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/1639cb9ccaa54b2592224df577abe822/release/en-US/index.html#Widget_MsetCssClass" target="_blank"&gt;https://help.sap.com/doc/1639cb9ccaa54b2592224df577abe822/release/en-US/index.html#Widget_MsetCssClass&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/00f68c2e08b941f081002fd3691d86a7/6d5e482fa76246fab1c53bbfdef81b3c.html" target="_blank"&gt;https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/00f68c2e08b941f081002fd3691d86a7/6d5e482fa76246fab1c53bbfdef81b3c.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps !!&lt;/P&gt;&lt;P&gt;Nikhil&lt;/P&gt;</description>
    <pubDate>Tue, 04 Nov 2025 09:19:56 GMT</pubDate>
    <dc:creator>N1kh1l</dc:creator>
    <dc:date>2025-11-04T09:19:56Z</dc:date>
    <item>
      <title>Dynamic Threshold-Based Background Color for SAC Numeric Point</title>
      <link>https://community.sap.com/t5/technology-q-a/dynamic-threshold-based-background-color-for-sac-numeric-point/qaq-p/14258986</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I'm looking to dynamically display threshold-based background colors for a Numeric Point widget in SAC.&lt;/P&gt;&lt;P&gt;I know that in SAC Tables, we can easily apply background colors to cells based on thresholds. However, for the Numeric Point widget, it seems only the text color can be customized dynamically—there’s no built-in option to change the background color based on values.&lt;/P&gt;&lt;P&gt;Currently, I’ve placed the Numeric Point inside a Panel, and while the Panel’s background color can be set manually, it’s static and doesn’t update dynamically with the Numeric Point’s value.&lt;/P&gt;&lt;P&gt;Does anyone have a solution to make the Numeric Point’s background color dynamic? For example, using custom CSS or SAC scripts?&lt;/P&gt;&lt;P&gt;Any insights would be greatly appreciated! Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;LI-PRODUCT title="SAP Analytics Cloud" id="67838200100800006884"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 09:28:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/dynamic-threshold-based-background-color-for-sac-numeric-point/qaq-p/14258986</guid>
      <dc:creator>Fiona_</dc:creator>
      <dc:date>2025-11-03T09:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Threshold-Based Background Color for SAC Nume...</title>
      <link>https://community.sap.com/t5/technology-q-a/dynamic-threshold-based-background-color-for-sac-numeric-point/qaa-p/14260105#M4930908</link>
      <description>&lt;P&gt;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1565995"&gt;@Fiona_&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May be you could explore using CSS in scripting.&amp;nbsp; You can use setcssclass method with an IF condition checking your threshold criteria.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/1639cb9ccaa54b2592224df577abe822/release/en-US/index.html#Widget_MsetCssClass" target="_blank"&gt;https://help.sap.com/doc/1639cb9ccaa54b2592224df577abe822/release/en-US/index.html#Widget_MsetCssClass&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/00f68c2e08b941f081002fd3691d86a7/6d5e482fa76246fab1c53bbfdef81b3c.html" target="_blank"&gt;https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/00f68c2e08b941f081002fd3691d86a7/6d5e482fa76246fab1c53bbfdef81b3c.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps !!&lt;/P&gt;&lt;P&gt;Nikhil&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2025 09:19:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/dynamic-threshold-based-background-color-for-sac-numeric-point/qaa-p/14260105#M4930908</guid>
      <dc:creator>N1kh1l</dc:creator>
      <dc:date>2025-11-04T09:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Threshold-Based Background Color for SAC Nume...</title>
      <link>https://community.sap.com/t5/technology-q-a/dynamic-threshold-based-background-color-for-sac-numeric-point/qaa-p/14260191#M4930916</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1565995"&gt;@Fiona_&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;we usually solve this issue by not changing the overall background color, since this is quite slow as it will include an OnResultChanged coding which not only needs to read the current value but also changes the CSS style of the numeric point. The slow part here is the coding for getting the current value (usually results in https request to the backend).&lt;/P&gt;&lt;P&gt;We therefore add one or more variances to the KPI like shown below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenisT_0-1762250009696.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/335942i2B44F3B0BCC1B15C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DenisT_0-1762250009696.png" alt="DenisT_0-1762250009696.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So although the background is not red, it´s already really quick to anticipate, if the KPI is "good" or "bad".&lt;/P&gt;&lt;P&gt;If you really need to change the background color, the steps with OnResultChanged are:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get the (new) value currently visible&lt;/LI&gt;&lt;LI&gt;Compare that value with you good/bad/neutral/... threshold&lt;/LI&gt;&lt;LI&gt;Based on the threshold, set the CSS Style using&amp;nbsp;setCssClass&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Upfront you oviously need to define different CSS classes for good/bad/neutral/...&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Denis&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2025 10:08:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/dynamic-threshold-based-background-color-for-sac-numeric-point/qaa-p/14260191#M4930916</guid>
      <dc:creator>DenisT</dc:creator>
      <dc:date>2025-11-04T10:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Threshold-Based Background Color for SAC Nume...</title>
      <link>https://community.sap.com/t5/technology-q-a/dynamic-threshold-based-background-color-for-sac-numeric-point/qaa-p/14260238#M4930928</link>
      <description>&lt;P&gt;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1565995"&gt;@Fiona_&lt;/a&gt;&amp;nbsp;as mentioned by&amp;nbsp;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/128223"&gt;@DenisT&lt;/a&gt;&amp;nbsp;, you can try the below workaround.&lt;/P&gt;&lt;P&gt;Create a custom CSS for positive and negative values defining the background colour.&lt;/P&gt;&lt;LI-CODE lang="css"&gt;.positive .sap-custom-chart-widget {
    background-color: #e6f9e6 ; /* Light green background */
    border: 1px solid #d1d5db; /* Subtle border */
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Soft shadow */
    opacity: 1; /* Fully visible */
}
.negative .sap-custom-chart-widget {
    background-color: #fde8e8 ; /* Light red background */
    border: 1px solid #d1d5db; /* Subtle border */
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Soft shadow */
    opacity: 1; /* Fully visible */
}&lt;/LI-CODE&gt;&lt;P&gt;use the below script for onresultchanged event of your numeric point chart to change the CSS class based on result.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Fetch data cell from the Numeric point chart
var result = Chart_1.getDataSource().getResultSet([{"M1_GL_ACCOUNT":"[M1_GL_ACCOUNT].[parentId].&amp;amp;[Units Sold]"}]); // get the value of your numeric data point.

var obj = result[0];

for (var item in obj)
	{
		var test = obj[item].rawValue;
	}
//Evaluate the value and assign a CSS style

var val = ConvertUtils.stringToInteger(test);

if (val &amp;gt; 100000){
		Chart_1.setCssClass("positive");
	} 
else if(val &amp;lt; 100000){
		Chart_1.setCssClass("negative");
	}
else{
	Chart_1.setCssClass("");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2025 11:39:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/dynamic-threshold-based-background-color-for-sac-numeric-point/qaa-p/14260238#M4930928</guid>
      <dc:creator>spurwar</dc:creator>
      <dc:date>2025-11-04T11:39:02Z</dc:date>
    </item>
  </channel>
</rss>

