Arcade for Chart

318
2
02-21-2022 05:29 AM
Jon-PaulMcCool
New Contributor III

If a layer has a numeric attribute that is stored as text, but I'd like to use that attribute to create charts and need it to be numeric, is there a way to create an expression to alter it to a number to use it for a chart?

I can readily create an expression if altering the symbology/style, but I see no way to essentially create a new attribute using Arcade for use in a chart. 

Using current map viewer.

0 Kudos
2 Replies
jcarlson
MVP Esteemed Contributor

On the configure popup menu:

  1. Create a custom popup expression
    Number($feature['your_numeric_string_field'])
  2. The new expression will be available in your chart settings:
    jcarlson_0-1645454081057.png

     

- Josh Carlson
Kendall County GIS
Jon-PaulMcCool
New Contributor III

Thank you very much Josh, but this only allows the use of the attribute in a popup chart (as far as I can tell). I'm trying to be able to use an expression attribute in a layer level chart. 

For example, using this earthquake data. If I wanted to use this expression 

round($feature.mag,0)

 but then to create a histogram of rounded magnitudes for the layer using Configure Charts, my expression is not available despite being a number. 

That is just an example. I've come across other attributes stored as text, that I could pass as number for use in popups, but no expression I make seems to be available for use in the Configure Charts section for use in creating layer charts (or master level charts? ... charts not in popups).

0 Kudos