Select to view content in your preferred language

Symbolizing features with multiple attributes

1767
5
Jump to solution
09-29-2022 03:01 PM
Labels (1)
by Anonymous User
Not applicable

Hello esri community,

I am trying to highlight chemistry sampling data for my organization. Each station point has several "chemistry analytes" that needs to be displayed. Different sampling labs measure different analytes for each station. 

I want to display the data in a way so that my organization knows which analyte has NOT been sampled.

My question is, is it possible to display what chemistry parameters are missing using pie / bar chart symbology given the current data table I'm working with? Can I accomplish this using any type of Arcade expression? I just want to understand how to best approach this.

Attached is the data table I'm working with, a screenshot of my work so far, and a screenshot of an ArcMap bart chart symbology that I would like to emulate.

Best,

Mina

0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Frequent Contributor

One possible way:

  • set the layer's definition query to remove all parameters you don't want to show
    JohannesLindner_11-1664539862262.png

     


     

  • create a symbol that shows text next to a colorable symbol, save to style
    JohannesLindner_1-1664536886590.pngJohannesLindner_2-1664536954292.png

     

  • apply that symbol to your layer
    JohannesLindner_3-1664538589467.png

     

  • enable symbol property connections
    JohannesLindner_4-1664538649620.png

     

  • change to the text element, set the text string to the parameter field
    JohannesLindner_5-1664538751878.pngJohannesLindner_6-1664538792287.png

     

  •  change to the symbol element, set the color to the Arcade expression
    JohannesLindner_7-1664538861556.pngJohannesLindner_8-1664539051437.png

     

 

var status = $feature.submissionstatus
if(status == "complete") { return "green" }
if(status == "rejected") { return "red" }
return "grey"​

 

  • change to the complete symbol, set the y offset to the Arcade expression
    JohannesLindner_9-1664539117587.pngJohannesLindner_10-1664539452547.png

     

 

var offsets = {
    "Chlorinated Hydrocarbons": 0,
    "Inorganics": -10,
    "PAH": -20,
    "PCB": -30,
    "PBDE": -40,
    "Pyrethroid": -50,
    // and so on
}
return offsets[$feature.parameter]​

 

  • apply

 

JohannesLindner_12-1664540002499.png

 


Have a great day!
Johannes

View solution in original post

0 Kudos
5 Replies
JohannesLindner
MVP Frequent Contributor

One possible way:

  • set the layer's definition query to remove all parameters you don't want to show
    JohannesLindner_11-1664539862262.png

     


     

  • create a symbol that shows text next to a colorable symbol, save to style
    JohannesLindner_1-1664536886590.pngJohannesLindner_2-1664536954292.png

     

  • apply that symbol to your layer
    JohannesLindner_3-1664538589467.png

     

  • enable symbol property connections
    JohannesLindner_4-1664538649620.png

     

  • change to the text element, set the text string to the parameter field
    JohannesLindner_5-1664538751878.pngJohannesLindner_6-1664538792287.png

     

  •  change to the symbol element, set the color to the Arcade expression
    JohannesLindner_7-1664538861556.pngJohannesLindner_8-1664539051437.png

     

 

var status = $feature.submissionstatus
if(status == "complete") { return "green" }
if(status == "rejected") { return "red" }
return "grey"​

 

  • change to the complete symbol, set the y offset to the Arcade expression
    JohannesLindner_9-1664539117587.pngJohannesLindner_10-1664539452547.png

     

 

var offsets = {
    "Chlorinated Hydrocarbons": 0,
    "Inorganics": -10,
    "PAH": -20,
    "PCB": -30,
    "PBDE": -40,
    "Pyrethroid": -50,
    // and so on
}
return offsets[$feature.parameter]​

 

  • apply

 

JohannesLindner_12-1664540002499.png

 


Have a great day!
Johannes
0 Kudos
JohannesLindner
MVP Frequent Contributor

You could of course also include the lab in the text by using your label expression instead of parameter. And you could also color the text by applying the color expression to the whole symbol instead of only to the symbol element:

JohannesLindner_13-1664540379553.png

 


Have a great day!
Johannes
0 Kudos
by Anonymous User
Not applicable

Hi @JohannesLindner ,

Your workflow worked great in ArcPro! Yet, when I tried to upload the layer as a web map, the arcade expressions used were not honored. I have worked on revising the web map on both the newer version and map viewer "classic", but I have yet to reach the same symbology. 

Attached below is a screenshot of how I'm using your code, for your reference.

Any help or guidance here on how to best approach this would be greatly appreciated!

 

Best,

Mina

0 Kudos
JohannesLindner
MVP Frequent Contributor

Huh. Try publishing the layer as web image layer / feature layer. That works for me in both Map Viewer versions. I use Portal, it might be different for AGOL.

JohannesLindner_0-1666164860521.png

 

As far as I know, the symbol options in Map Viewer are pretty basic, so you probably won't be able to configure that symbology online. I could be wrong though, as I configure everything in Pro before publishing.


Have a great day!
Johannes
0 Kudos
by Anonymous User
Not applicable

Hi @Johannus ,

This was exactly the type of workflow I was looking for! I found your post to be exceptionally insightful and informative. I definitely learned a few new things along the way. Thanks a ton!

 

Best,

Mina

0 Kudos