Skip to main content

Changing color of a shape based on record properties

Comments

2 comments

  • Permanently deleted user

    Hi @Denise Beckham?,

     

    This can be accomplished in GR5. My following example is close to your use case. I color the arrows based on the value of the object id field on the far left:

    GR5_colorbyvalue_out

     

    Arrows for objectids less than 3267250 are blue, objectids over 3267249 and less than 3267651 are yellow, and all others are green.

     

    I added the expression for the fill color by clicking the shape, clicking the expressions button, then setting the Fill Color property.

    GR5_colorbyvalue_designer

     

    This is the expression I used:

    Iif([objectid] < 3267250, 'Blue', Iif([objectid] < 3267651 , 'Yellow', 'Green') )

    You would want something like:

    Iif([score] < 70, 'Red', Iif([score] < 80 , 'Green', 'Yellow') )

     Edit: Added an image

    0
  • Denise Beckham

    Excellent! I somehow hadn't noticed "Appearance" in the expressions tab.

    After playing around with the color picker (and Googling how to adjust transparency in hex values [Apparently the two values that control transparency go in front of the six values for color in this case.]), I ended up using the following expression:

     

    Iif( [score] >= 90, '#66007fbf', [score] < 90 AND [score] >= 80, '#661f9404', [score] < 80 AND [score] >= 70, '#80d3de00', '#66b80000')

     

    Thank you for your help, Peter!

    0

Please sign in to leave a comment.