Select to view content in your preferred language

Add progress bar value based on field to ArcGIS online Map

1189
3
Jump to solution
02-18-2022 10:04 AM
CCWeedcontrol
Frequent Contributor

I am trying to add a progress bar to an ArcGIS online map, pretty much like the example from MikeSchoelen. 

https://community.esri.com/t5/arcgis-dashboards-blog/adding-a-progress-bar-to-an-indicator-with-a/ba...

I have tried configuring the Custom Attribute Display in the maps Configure pop-up but I have been unsuccessful. I would appreciate any info on how to do this. I've been trying to do this in HTML but Arcade would be ok as well.

 

 

 

 

<h1>The progress element</h1>

<label for="file">Downloading progress:</label>
<progress id="file" max="100" value="32"> 32% </progress>

0 Kudos
1 Solution

Accepted Solutions
BlakeTerhune
MVP Regular Contributor

You can use the Text() function to convert other values to a string. However, it might be easier to just do your evaluation as a number.

IIF($feature.PercentCom == 25, 'background-color:#1987bb', 'background-color:#DDDDDD')

View solution in original post

0 Kudos
3 Replies
CCWeedcontrol
Frequent Contributor

I was able to accomplish this with the following but it only works for "Text" fields. My fields is a Long field.

How can change the Arcade code to accept the long field?

Arcade

IIF($feature.PercentCom == '25', 'background-color:#1987bb', 'background-color:#DDDDDD')

 

HTML

<span><b><br /><br /><br />Phase</b></span>
<table style=" border-collapse: separate; border-spacing: 6px 4px; width: 100%; table-layout: fixed;">
  <tbody><tr height="16">
    <td style="{expression/expr0}"></td>
    <td style="{expression/expr1}"></td>
    <td style="{expression/expr2}"></td>
    <td style="{expression/expr3}"></td>
  </tr>
  <tr height="24" style="text-align: center;">
    <td>25%</td>
    <td>50%</td>
    <td>75%</td>
    <td>100%</td>
  </tr>
</tbody></table>

 

0 Kudos
BlakeTerhune
MVP Regular Contributor

You can use the Text() function to convert other values to a string. However, it might be easier to just do your evaluation as a number.

IIF($feature.PercentCom == 25, 'background-color:#1987bb', 'background-color:#DDDDDD')
0 Kudos
CCWeedcontrol
Frequent Contributor

I used the following. took me a while to figure out that ")" went after the $feature.percentage.

 

IIF(Text($feature.percentage) == '25', 'background-color:#1987bb', 'background-color:#DDDDDD')

0 Kudos