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.
Solved! Go to Solution.
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.
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.
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.