Select to view content in your preferred language

Set color of calculated value

171
9
Jump to solution
Thursday
Slamon
by
Regular Contributor

I am trying to set the color of a calculated value to be green.  It's a decimal field and a simple equation, but I'm not getting anywhere with the samples provided by Esri or in the reference tab.

This is what I have tried: <div style="color:green">round(sum(${REL_TOTAL_VOL}),2)</div>

but S123 just kicks back an error that is doesn't understand the string.

0 Kudos
1 Solution

Accepted Solutions
Neal_t_k
Frequent Contributor

You would put the html in the label field and you might need to  adjust it a bit to meet  your needs.  Maybe something like this:

<div style="color:green">Total Event Volume (BBL): ${TOTAL_EVENT_VOL}</div>

Neal_t_k_1-1765488275707.png

 

 

View solution in original post

0 Kudos
9 Replies
Neal_t_k
Frequent Contributor

Try this to see if it worker for you, put the calculation in a helper field.

helper field calculation = round(sum(${REL_TOTAL_VOL}),2)

then in a note field put the html formatting:

note field label = <div style="color:green">${helperfield}</div>

Slamon
by
Regular Contributor

It's still not liking something

XLS.jpg

Error.jpg

0 Kudos
Neal_t_k
Frequent Contributor

You would put the html in the label field and you might need to  adjust it a bit to meet  your needs.  Maybe something like this:

<div style="color:green">Total Event Volume (BBL): ${TOTAL_EVENT_VOL}</div>

Neal_t_k_1-1765488275707.png

 

 

0 Kudos
Slamon
by
Regular Contributor

Wouldn't that set the color for just the label and not the calculated values in the box?

0 Kudos
Neal_t_k
Frequent Contributor
0 Kudos
Slamon
by
Regular Contributor

What I'm trying to get is the values within the boxes to be green.

0 Kudos
Neal_t_k
Frequent Contributor

If you want you should be able to format more like a table like your picture using html, it would be trial and error for me, but it should be possible.  Or use multiple html tags to have a black label and a green value. 

0 Kudos
Neal_t_k
Frequent Contributor

Might have to tweek some more and update the field names but here is an example of a html table format you can paste in the label field of your note:

<table border="1">
  <tr>
    <th>Total Event Volume (BBL)</th>
    <th>Total Event Oil Volume (BBL)</th>
    <th>Total Event Produced Water/Other Volume (BBL)</th>
  </tr>
  <tr>
    <td style="color:green">${TOTAL_EVENT_VOL}</td>
    <td style="color:green">${TOTAL_EVENT_VOL}</td>
    <td style="color:green">${TOTAL_EVENT_VOL}</td>
  </tr>
 
</table>

  

0 Kudos
Slamon
by
Regular Contributor

Nevermind... I see where I went wrong with your example, and that should work.

0 Kudos