<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Arcade Code for Heat Chart in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-code-for-heat-chart/m-p/1501627#M9922</link>
    <description>&lt;P&gt;Lauren, did you ever figure this out?&amp;nbsp; I am trying something similar.&amp;nbsp; Works great with defined integers.&amp;nbsp; I also would like it to be dynamic and tried this.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Brian_DesLauriers_1-1720114847748.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/108843i6D4A25EC7B75288F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Brian_DesLauriers_1-1720114847748.png" alt="Brian_DesLauriers_1-1720114847748.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It is a little off and I can't seem to dial it in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2024 17:41:38 GMT</pubDate>
    <dc:creator>Brian_DesLauriers</dc:creator>
    <dc:date>2024-07-04T17:41:38Z</dc:date>
    <item>
      <title>Arcade Code for Heat Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-code-for-heat-chart/m-p/1320763#M8338</link>
      <description>&lt;P&gt;My end goal is to have a heat chart based on hour of day/day of week for calls for service. However, I have a filter on the date range so the color heat groups need to adjust as the data adjusts. I'm unable to figure out a way to gather all sum values and put in an array for me to get the max and min from the whole table. Below is where I'm at but I believe I need to somehow loop through the table using $rowindex?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;PRE&gt;// gather all sum values from chart to find max, min, and create 5 color groups
var myArray = [$datapoint.sum_Mon,$datapoint.sum_Tue,$datapoint.sum_Wed, $datapoint.sum_Thur, $datapoint.sum_Fri, $datapoint.sum_Sat, $datapoint.sum_Sun]
var groupDiff = (Max(myArray)-Min(myArray))/5
var groupTwo = groupDiff * 2 
var groupThree = groupDiff * 3
var groupFour = groupDiff * 4

function cellColor(callStatByDay){
  return When(callStatByDay &amp;lt; groupDiff, '#eecb9a',
                callStatByDay &amp;gt;= groupDiff &amp;amp;&amp;amp; callStatByDay &amp;lt; groupTwo, '#e7b48f',
                callStatByDay &amp;gt;= groupTwo &amp;amp;&amp;amp; callStatByDay &amp;lt; groupThree, '#e09d85',
                callStatByDay &amp;gt;= groupThree &amp;amp;&amp;amp; callStatByDay &amp;lt; groupFour, '#d9867a', '#c06677' )
}   

return {
  cells: {
    Hour: {
      displayText : $datapoint.Hour,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    sum_Mon: {
      displayText : $datapoint.sum_Mon,
      textColor: '',
      backgroundColor: cellColor($datapoint.sum_Mon),
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    sum_Tue: {
      displayText : $datapoint.sum_Tue,
      textColor: '',
      backgroundColor: cellColor($datapoint.sum_Tue),
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    sum_Wed: {
      displayText : $datapoint.sum_Wed,
      textColor: '',
      backgroundColor: cellColor($datapoint.sum_Wed),
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    sum_Thur: {
      displayText : $datapoint.sum_Thur,
      textColor: '',
      backgroundColor: cellColor($datapoint.sum_Thur),
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    sum_Fri: {
      displayText : $datapoint.sum_Fri,
      textColor: '',
      backgroundColor: cellColor($datapoint.sum_Fri),
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    sum_Sat: {
      displayText : $datapoint.sum_Sat,
      textColor: '',
      backgroundColor: cellColor($datapoint.sum_Sat),
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    sum_Sun: {
      displayText : $datapoint.sum_Sun,
      textColor: '',
      backgroundColor: cellColor($datapoint.sum_Sun),
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    }
  }
}&lt;/PRE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LaurenCammack01_0-1692633736346.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/78689iCEC14D8763167D8F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LaurenCammack01_0-1692633736346.png" alt="LaurenCammack01_0-1692633736346.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 Aug 2023 16:04:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-code-for-heat-chart/m-p/1320763#M8338</guid>
      <dc:creator>LaurenCammack01</dc:creator>
      <dc:date>2023-08-21T16:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Code for Heat Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-code-for-heat-chart/m-p/1320771#M8339</link>
      <description>&lt;P&gt;Advanced formatting evaluates per row, so there's not a good way of pulling in values from other rows.&lt;/P&gt;&lt;P&gt;If the data came in from the Data Expression, you could find the absolute min/max values and insert them as per-row attributes for the sake of calculating a cell color. But I don't think that will be dynamic in a way the responds to a filter. The only widgets that allow for interactive reference values are indicators, I believe.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 16:13:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-code-for-heat-chart/m-p/1320771#M8339</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-08-21T16:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Code for Heat Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-code-for-heat-chart/m-p/1501627#M9922</link>
      <description>&lt;P&gt;Lauren, did you ever figure this out?&amp;nbsp; I am trying something similar.&amp;nbsp; Works great with defined integers.&amp;nbsp; I also would like it to be dynamic and tried this.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Brian_DesLauriers_1-1720114847748.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/108843i6D4A25EC7B75288F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Brian_DesLauriers_1-1720114847748.png" alt="Brian_DesLauriers_1-1720114847748.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It is a little off and I can't seem to dial it in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 17:41:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-code-for-heat-chart/m-p/1501627#M9922</guid>
      <dc:creator>Brian_DesLauriers</dc:creator>
      <dc:date>2024-07-04T17:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Code for Heat Chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-code-for-heat-chart/m-p/1501784#M9925</link>
      <description>&lt;P&gt;I have not figured this out, if you get your to work successfully please let me know!&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;any suggestions?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 11:59:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-code-for-heat-chart/m-p/1501784#M9925</guid>
      <dc:creator>LaurenCammack01</dc:creator>
      <dc:date>2024-07-05T11:59:01Z</dc:date>
    </item>
  </channel>
</rss>

