I have a single value text box and i need to fill the box with any color irrespective of the count/range.
Lets say, i have below result
Prod Count
ABC 10
XYZ 2
PQR 22
Here i need my Single value text box colour as RED when Prod is ABC, BLUE when Prod is PQR...
I tried with rangemap like
eval product=case(prod=="ABC",0,prod=="XYZ",10)|rangemap field=product low=0-9 medium=10-19, but it gives black color...
i am using only these options,
colorBy - value
colorMode - block
underLabel - Prod- ABC
useColors - 1
@harish_ka, You would need to use three Single Value visualizations one for ABC, XYZ and PQR each. Since you want each of your single values to be colored based on the Prod value, you can code static colors using rangeColors for both min-0 and 0-max as
Red (0x6db7c6) for PQR
<option name="colorMode">block</option>
<option name="rangeColors">["0x6db7c6","0x6db7c6"]</option>
<option name="rangeValues">[0]</option>
<option name="underLabel">PQR</option>
<option name="useColors">1</option>
Blue(0xd93f3c), for ABC
<option name="colorMode">block</option>
<option name="rangeColors">["0xd93f3c","0xd93f3c"]</option>
<option name="rangeValues">[0]</option>
<option name="underLabel">ABC</option>
<option name="useColors">1</option>
and in this case Green(0x65a637) for XYZ
<option name="colorMode">block</option>
<option name="rangeColors">["0x65a637","0x65a637"]</option>
<option name="rangeValues">[0]</option>
<option name="underLabel">XYZ</option>
<option name="useColors">1</option>
@harish_ka, You would need to use three Single Value visualizations one for ABC, XYZ and PQR each. Since you want each of your single values to be colored based on the Prod value, you can code static colors using rangeColors for both min-0 and 0-max as
Red (0x6db7c6) for PQR
<option name="colorMode">block</option>
<option name="rangeColors">["0x6db7c6","0x6db7c6"]</option>
<option name="rangeValues">[0]</option>
<option name="underLabel">PQR</option>
<option name="useColors">1</option>
Blue(0xd93f3c), for ABC
<option name="colorMode">block</option>
<option name="rangeColors">["0xd93f3c","0xd93f3c"]</option>
<option name="rangeValues">[0]</option>
<option name="underLabel">ABC</option>
<option name="useColors">1</option>
and in this case Green(0x65a637) for XYZ
<option name="colorMode">block</option>
<option name="rangeColors">["0x65a637","0x65a637"]</option>
<option name="rangeValues">[0]</option>
<option name="underLabel">XYZ</option>
<option name="useColors">1</option>
@niketnilay Thanks for this answer, it worked 🙂
So what if i have only one 'Single Value text box' and need to change the color based on prod value .
If my search returns result of prod value as ABC then Blue,
If my search returns result of prod value as XYZ then Green...