Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text Format, Color in Dimension of Chart

Hey,

I want to personalize the Text Format in the Dimension of a  chart under a condition:

If a element in the Dimension contain the word '(not active)' then I want to have this text with the function (strikethrough): ABCD (not active). In the same time I want to have this element with another Text Color.

I have already tried a few solutions but it doesn't work:

Dimensions ---> Text Format ---> Edit Expression:        =if([Dimension Noun]='XYZ (not active)', chr(822) & 'XYZ (not active)' & chr(822), 'XYZ (not active)')

Dimensions ---> Text Color ---> Edit Expression:       =if([Dimension Noun]='XYZ (not active)', RGB(195,195,195), RGB(0,0,0))

Thanks in advance

7 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Strike through is not available as a format option in the expression text/expressions style or custom formats, so I don't think its possible to conditionally display a strike through.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

ok, but can I change the Text Color ?

Not applicable
Author

Hi Mohamed!

As Jonathan said, I think strikethrough is not available. However, to change the colour of dimension with the "(not active)" text, you can use the SubstringCount() function:

=if(SubstringCount([Dimension Noun],'(not active)')>0, RGB(195,195,195), RGB(0,0,0))

Explaining: if there is one or more occurences of the substring "(not active)" in the dimension text, the color will be changed.

But:

Depending on the type of your chart, you can not change the colour of dimension, only the colour of the respective expression value. Which type of chart are you using?

Best regards,

Marcello

Not applicable
Author

Hi Marcello;

Thank you for your Answer, I'm using the Combo Chart. I have tried to write this expression into the Dimension -> Used Dimension -> Text Color but it doesn't work.

to explain:

I have more than 20 sentences into the Dimension. I want that if within a sentence the expression (not active) will be found then all the sentence or just the expression (not active) became another color for example RGB (195,195,195).

Your expression seems perfect but I don't know why it doesn't work!!

Best regard

Mohamed

Not applicable
Author

Hi Mohamed!

In Bar chart it didn't work, in Combo Chart wouldn't be different.

What you think to use the expression in Text Color of the Expression (in Expression tab)? Do you display the values of the expression on Data Points? In the expression text color it will work certainly!

Best regards,

Marcello

Not applicable
Author

Hi Marcello,

Thank you for your Help and sorry that I answer you late (I wasn't in the Office the last days). I have tried your solution but it doesn't work I don't know where is the Problem.

In the Expression Tab I have more than 20 Expressions (in 6 Expressions I have already Background Color and it work without a problem), I have tried to put the same Text Color in each of them but it doesn't work. 

Yes later I display the values on Data Points !!

Thank you again for your Help !!!

Best regards,

Mohamed

Not applicable
Author

Hi Mohamed!

Would you mind to attach the QVW?

Marcello