Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community! 🙂
Please help me with expression for pie chart color. I have questionare with few questions and one pie chart to show them one by one using this expression to choose dimension (question):
=$(=subfield(GetFieldSelections([Question_number]),',',))
Each question has different number and type of possible answers, but all has one common - 'Others'.
For example I'm using this for pie popout: =$(=subfield(GetFieldSelections([Question_number]),',',))='Others'
And now I want to use something similar for set color of that 'Others', but not of the rest.
Somthing like this? if($(=subfield(GetFieldSelections([Question_number]),',',))='Others', RGB(255,0,0),Rand)
Expression tab->Expand Expression-> Background color : Expression:
=If(YourDimension='Others', Red(),Color(100*Rand()))
Hi,
Can you please attach some sample.
-Shruti
Hi Mir,
Did you try this yet: =If(WildMatch([Question_number],'*Other*'),RGB(255,0,0),Rand)
Regards,
Sokkorn
Hi,
Give this expression in Background expression
=If(WildMatch([Question_number],'*Others*'),RGB(255,0,0))
Hope this helps you.
Regards,
Jagan.
You can click the + sign on expression,and then in Background expression write the conditions of coloring
WOW, I didn't expect so quick response, THANKS! 🙂
But saddly, when I use
=If(WildMatch([Question_number],'*Others*'),RGB(255,0,0)) solution or
=If(WildMatch([Question_number],'*Other*'),RGB(255,0,0),Rand) everything is black.
Maybe I could describe it better by picture (I probably shouldn't share data):
When I use this expression:
if($(=subfield(GetFieldSelections([Question_number]),',',))='Others', RGB(255,0,0),Rand)
'Others' (which is always same for all questions) should have always one color, but rest should have different colors (doesn't matter too much which color).
No answers? So it's not possible?
How do you get this 'Others' ? Is it coming from a field or getting by using limit (dimension limit)?
I have in questionaire 3-5 questions plus other where could be free text. In QV script I use IF stement to define these 3-5 questions and these answers, which doesn't match these predefined is set to 'Others' by ELSE statement.
Expression tab->Expand Expression-> Background color : Expression:
=If(YourDimension='Others', Red(),Color(100*Rand()))