Render based on time

390
2
Jump to solution
05-15-2022 02:53 PM
JérômeDuckers
New Contributor III

Hello,

I need to display symbol depending of a date.

If the date > TODAY => symbol Red

if the date <= TODAY  => symbol Blue

if the date < TODAY  - 2 YEARS => symbol Yellow.

 

Do you have an idea, how to implement that ?

 

Thanks.

0 Kudos
1 Solution

Accepted Solutions
PreetiMaske
Esri Contributor

Hi,
If you are using a published feature layer, this can be achieved by setting VisualVariables  on the layer before publishing the layer. VisualVariable info gets baked into layer's renderer info. For more info please refer to ArcGIS Pro documentation on how to achieve this

https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/vary-symbology-by-color.htm

Once you apply the visual variable on the layer renderer, the color will get dynamically calculated based on the expression and runtime will honor the color based on expression at render time . Currently there is no API to update or set these dynamic visual variable via Runtime SDKs. Hopefully sometime in near future.

If `Today` is not a dynamic value then you can achieve this via Runtime SDK by setting a UniqueValueRenderer, but looking at your use case it looks like that `TODAY` is perhaps a dynamic value that changes everyday.

Hope this helps.

 

View solution in original post

0 Kudos
2 Replies
PreetiMaske
Esri Contributor

Hi,
If you are using a published feature layer, this can be achieved by setting VisualVariables  on the layer before publishing the layer. VisualVariable info gets baked into layer's renderer info. For more info please refer to ArcGIS Pro documentation on how to achieve this

https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/vary-symbology-by-color.htm

Once you apply the visual variable on the layer renderer, the color will get dynamically calculated based on the expression and runtime will honor the color based on expression at render time . Currently there is no API to update or set these dynamic visual variable via Runtime SDKs. Hopefully sometime in near future.

If `Today` is not a dynamic value then you can achieve this via Runtime SDK by setting a UniqueValueRenderer, but looking at your use case it looks like that `TODAY` is perhaps a dynamic value that changes everyday.

Hope this helps.

 

0 Kudos
JérômeDuckers
New Contributor III

Hi,

 

Thanks for your response, indeed, I will process the feature in arcgis pro, adding a new column.

Then I can use the UniqueValueRenderer .

 

thanks,

Jérôme.

0 Kudos