Good day
I am looking to display 2 different attributes on a single symbol. Ideally, I am looking to use a split symbol (e.g. circle 6) where one attribute value is displayed in one color on one side of the symbol, and the other attribute is displayed as a different color on the other side of the symbol.
Could someone suggest a way that i can do this
regards
Solved! Go to Solution.
Try allowing symbol property connections (Attribute driven symbology) .
For example
To get this, I set it to use Symbol Property Connections
Then, for each symbol layer, I set the color property to be a given field in my table. (Note the blue database symbol-- that means that property is connected to an attribute)
In your case, you'd probably want to use an actual arcade expression so you can match colors to certain values, like
if ($feature.column1 == "School"){
return "#00ffff"
}else{
return "000000"
}
I use this sort of thing (not for color, but I wish I had-- that'd've been easier by a lot) pretty frequently, e.g. setting labels or drawing the radius of a circle dynamically as part of the symbol. Huge shoutout to @JohannesLindner for figuring that out for me.
Unless someone else can provide a more straightforward process, I think this solution (though it applies to lines) could be adapted to points and get you started.
Here's some documentation from tech support that will point to this solution. It essentially references the solution from the above community post.
Here's a solution I used for our Lead Service Line inventory. It uses an Arcade code snippet to identify two different attributes as variables and then create symbol classes for the different combinations. You could do something similar and change the resulting "when categories" to meet your needs.
var sm = $feature.SysMaterial
var cm = $feature.CustMaterial
when (
cm == 'Unknown' && sm == 'Unknown', 'Both Unknown',
cm == 'Unknown' && sm != 'Unknown', 'Customer Unknown',
cm != 'Unknown' && sm == 'Unknown', 'System Unknown',
cm == 'Lead', 'Lead',
sm == 'Lead', 'Lead',
'Non-Lead')
Try allowing symbol property connections (Attribute driven symbology) .
For example
To get this, I set it to use Symbol Property Connections
Then, for each symbol layer, I set the color property to be a given field in my table. (Note the blue database symbol-- that means that property is connected to an attribute)
In your case, you'd probably want to use an actual arcade expression so you can match colors to certain values, like
if ($feature.column1 == "School"){
return "#00ffff"
}else{
return "000000"
}
I use this sort of thing (not for color, but I wish I had-- that'd've been easier by a lot) pretty frequently, e.g. setting labels or drawing the radius of a circle dynamically as part of the symbol. Huge shoutout to @JohannesLindner for figuring that out for me.
Hi
Thanks for the assist..just a quick follow on. I made the change but my legend doesnt reflect the change in colors. How do i update the legend?
regards
Ugh. I haven't found a good way, tbh. Best workaround I can think of is to either
1) Make two layers with the unique values and have those appear in your legend while hiding the main one
Tip: Save the individual parts of the symbol you want to a style so you can format all symbols in the layer.
Or:
2) Manually make your legend using graphics symbols
This seems kind of similar to a dictionary symbol? When I made this, the presence of each symbol meant that that amenity was there, and in the case of Water, it had three options: Not there, There and Potable, and There and Non-potable.
In this case, I think the first solution is probably better, although neither is great.
Thanks again, i think i will go with option 1 with the legend, makes things a bit more complicated but still looks like the best option
Because currently there is no legend support for layers using the Dictionary Renderer, I have seen other examples of customers doing this (option 1 - create another layer with a unique value renderer of specifically the symbols you want in your legend) which have turned out pretty well.
This is a public example from the National Park Service in Yosemite. They used this web map in a dashboard. You can see the `HydroMet Stations` group layer has two layers in it... one is `HydroMet Stations` (which is the real data used with the Dictionary Renderer) and the other is `Data Status` which is an empty layer with symbology set up in a nice way specifically for the legend. I think this turned out nicely in the app and actually gave them a more specific way to show these multi-attribute status symbols without having to show every permutation as a separate symbol in the legend.
Web map:
App (link) :
Kerry
Hi- another option is to use the Dictionary Renderer. A blog post was actually just published discussing how to use the Dictionary Renderer for status symbols driven by multiple attributes. It shows how to use 3+ attributes and provides a style with some examples on how to support up to 7 attributes... so you would need to update that style to instead use a circle divided in 2 parts. This is a handy example web application to demonstrate how the symbols update as you change the attribute values.
At the end of the blog, there are links to several other blogs and resources describing how to create/customize dictionary styles.
If you're interested in going down this road, and need any additional help/guidance, let me know!
Hi
I just wanted to thank you for your reply, while your solution wasnt quite what i had in mind for this request i do believe that it will be useful for me in the near future.
Thanks again