cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Analytics Designer - Value/Measure based CSS of Table Rows

Alexander_Blasl
Participant

Hi,

is it possible to set the font or backround color of a row to a specific color based on a value/measure? Somehow like this?

carlbine
Explorer
0 Kudos

have you solved this? I need to do this too.

Alexander_Blasl
Participant

No, its still not possible.

carlbine
Explorer
0 Kudos

I got this http://jsfiddle.net/mMFwQ/4/ but i don't know hot to apply it on SAC or if it is possible on SAC

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Kudos

it seems that setStyle can work properly as setCssClass.

Example:

var mycolor = "#000";

var mybackgroundcolor = "#e3f542";

argTextBox.setStyle({backgroundColor: mybackgroundcolor, color: mycolor});

Try it!

Kr, Armando Santos

Alexander_Blasl
Participant
0 Kudos

armando_santos1970 thats no solution to the question. Please read above. Currently there is no possibility to setStyle of a specific Table Row.

Marc_Kuipers
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ablasl88

I used the hard-coded option, which may be feasible if you don't have too many lines.

So, defined 3 styles, each highlighting a different row. Then, based on the selection (I used a radio-button), you set the style.

Thanks

Marc

Alexander_Blasl
Participant
0 Kudos

marc.kuipers thanks, but I need this dynamically based on a value. Like highlight all rows that have a value above 10,000.00. Without a button and onInitalization

avsalynin
Active Contributor
0 Kudos

ablasl88

I gave an example in the comments of my blog, how to control the highlighting of rows in a table in a simple script and with nth-child(). See if it can be helpful. image.png
Alexander_Blasl
Participant
0 Kudos

Hi avsalynin, thx but I already checked everything including your blog. I came to the same question to you as Dipankar:

avsalynin
Active Contributor
0 Kudos

ablasl88

yes, unfortunately, it is impossible to transfer and fill in a parameter/variable directly in nth-child() css.

Marc_Kuipers
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ablasl88

Yes, you're right - this isn't possible. The problem is that you need to define the styles in the CSS style of the canvas, and at that time you will not know which row needs to be highlighted

The only option using CSS is to define multiple styles, each highlighting a different row and then setting this based on the number - but that isn't a practical solution

Marc

VijayetaSharma
Active Contributor
0 Kudos

Just fyi - this should be able to achieve via story. At least somewhat comparable using threshold function.


Thanks,

Vijayeta

Alexander_Blasl
Participant
0 Kudos

Thresholds only works for Measure Columns. I want to change the color (font-color would be best) of a Dimension Column for a better extra visibility.

Marc_Kuipers
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ablasl88

Should be possible, see this blog: https://blogs.sap.com/2021/01/08/how-to-use-css-capabilities-to-design-the-look-and-feel-of-analytic...

Not sure if your widget supports the 'pseudo'

Marc

Alexander_Blasl
Participant
0 Kudos

marc.kuipers I've already seen this blog, but I couldnt figure out how to do it. Do you have any ideas or could share some code?