<?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: How to show a range in a serial chart in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1082169#M4838</link>
    <description>&lt;P&gt;What you're describing is a &lt;EM&gt;histogram&lt;/EM&gt;, which is sort of a different animal from the &lt;EM&gt;serial chart&lt;/EM&gt;. It's something others have expressed an interest in as well.&lt;/P&gt;&lt;P&gt;Fortunately, with the latest updates to Dashboards, you can use a &lt;STRONG&gt;Data Expression&lt;/STRONG&gt; to create what you need. Try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var fs = [2,12,24,36,48,55,6,16,26,36,46,12,7,18,12,41]

// static list is for testing; use FeatureSetByPortalItem to get the actual values

var bins = {
    '0 to 10': {'attributes': {'bin':'0 to 10', 'count': 0}},
    '11 to 20': {'attributes': {'bin':'11 to 20', 'count': 0}},
    '21 to 30': {'attributes': {'bin':'21 to 30', 'count': 0}},
    '31 to 40': {'attributes': {'bin':'31 to 40', 'count': 0}},
    '41 to 50': {'attributes': {'bin':'41 to 50', 'count': 0}},
    '51 to 60': {'attributes': {'bin':'51 to 60', 'count': 0}}
}

for(var f in fs){
    if(fs[f] &amp;lt; 11){
        bins['0 to 10']['attributes']['count'] ++
    } else if(fs[f] &amp;lt; 21){
        bins['11 to 20']['attributes']['count'] ++
    } else if(fs[f] &amp;lt; 31){
        bins['21 to 30']['attributes']['count'] ++
    } else if(fs[f] &amp;lt; 41){
        bins['31 to 40']['attributes']['count'] ++
    } else if(fs[f] &amp;lt; 51){
        bins['41 to 50']['attributes']['count'] ++
    } else{
        bins['51 to 60']['attributes']['count'] ++
    }
}

var feat_arr = []

for(var b in bins){
    Push(feat_arr, bins[b])
}

var out_fs = {
    'fields': [{'name':'bin', 'type':'esriFieldTypeString'},
               {'name':'count', 'type':'esriFieldTypeInteger'}],
    'geometryType': '',
    'features': feat_arr
}

return FeatureSet(Text(out_fs))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This results in the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1627049399209.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19226iE9D73B1A522C1469/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1627049399209.png" alt="jcarlson_0-1627049399209.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see, Data Expressions can be &lt;EM&gt;very &lt;/EM&gt;handy, if built properly. Best of luck!&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jul 2021 18:07:14 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-07-30T18:07:14Z</dc:date>
    <item>
      <title>How to show a range in a serial chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1082095#M4837</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is it possible to show how many records fall within each range on a serial chart?&lt;/P&gt;&lt;P&gt;I've attached a spreadsheet to show what I mean.&lt;/P&gt;&lt;P&gt;Any help much appreciated.&lt;/P&gt;&lt;P&gt;Rachel&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 08:51:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1082095#M4837</guid>
      <dc:creator>RachelS</dc:creator>
      <dc:date>2021-07-23T08:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to show a range in a serial chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1082169#M4838</link>
      <description>&lt;P&gt;What you're describing is a &lt;EM&gt;histogram&lt;/EM&gt;, which is sort of a different animal from the &lt;EM&gt;serial chart&lt;/EM&gt;. It's something others have expressed an interest in as well.&lt;/P&gt;&lt;P&gt;Fortunately, with the latest updates to Dashboards, you can use a &lt;STRONG&gt;Data Expression&lt;/STRONG&gt; to create what you need. Try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var fs = [2,12,24,36,48,55,6,16,26,36,46,12,7,18,12,41]

// static list is for testing; use FeatureSetByPortalItem to get the actual values

var bins = {
    '0 to 10': {'attributes': {'bin':'0 to 10', 'count': 0}},
    '11 to 20': {'attributes': {'bin':'11 to 20', 'count': 0}},
    '21 to 30': {'attributes': {'bin':'21 to 30', 'count': 0}},
    '31 to 40': {'attributes': {'bin':'31 to 40', 'count': 0}},
    '41 to 50': {'attributes': {'bin':'41 to 50', 'count': 0}},
    '51 to 60': {'attributes': {'bin':'51 to 60', 'count': 0}}
}

for(var f in fs){
    if(fs[f] &amp;lt; 11){
        bins['0 to 10']['attributes']['count'] ++
    } else if(fs[f] &amp;lt; 21){
        bins['11 to 20']['attributes']['count'] ++
    } else if(fs[f] &amp;lt; 31){
        bins['21 to 30']['attributes']['count'] ++
    } else if(fs[f] &amp;lt; 41){
        bins['31 to 40']['attributes']['count'] ++
    } else if(fs[f] &amp;lt; 51){
        bins['41 to 50']['attributes']['count'] ++
    } else{
        bins['51 to 60']['attributes']['count'] ++
    }
}

var feat_arr = []

for(var b in bins){
    Push(feat_arr, bins[b])
}

var out_fs = {
    'fields': [{'name':'bin', 'type':'esriFieldTypeString'},
               {'name':'count', 'type':'esriFieldTypeInteger'}],
    'geometryType': '',
    'features': feat_arr
}

return FeatureSet(Text(out_fs))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This results in the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1627049399209.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19226iE9D73B1A522C1469/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1627049399209.png" alt="jcarlson_0-1627049399209.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see, Data Expressions can be &lt;EM&gt;very &lt;/EM&gt;handy, if built properly. Best of luck!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 18:07:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1082169#M4838</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-07-30T18:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to show a range in a serial chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1082193#M4840</link>
      <description>&lt;P&gt;Josh thanks for your help.&lt;/P&gt;&lt;P&gt;Is this only available in 10.9 version of Enterprise?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rachel&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 14:43:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1082193#M4840</guid>
      <dc:creator>RachelS</dc:creator>
      <dc:date>2021-07-23T14:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to show a range in a serial chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1082264#M4843</link>
      <description>&lt;P&gt;It's not even in Enterprise yet, this is only for the latest Dashboards version, which is AGOL-only at the moment. I'm hoping it's coming in 10.9.1, though!&lt;/P&gt;&lt;P&gt;If you're stuck w/ Enterprise, the next best option is to create a field called "bin" and use a field calculation to populate its value.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 17:27:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1082264#M4843</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-07-23T17:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to show a range in a serial chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1084524#M4874</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you so much for providing this detailed solution but I am having a bit of trouble using the &lt;/SPAN&gt;&lt;STRONG&gt;FeatureSetByPortalItem&lt;/STRONG&gt;&lt;SPAN&gt; function to get the actual values from my data layer to work. If it's alright, could you perhaps provide a few lines of code that demonstrate how to use the &lt;/SPAN&gt;&lt;STRONG&gt;FeatureSetByPortalItem&lt;/STRONG&gt;&lt;SPAN&gt; to retrieve field values from an existing feature layer to use in this histogram workflow?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You see, while I know how to properly define the &lt;/SPAN&gt;&lt;STRONG&gt;FeatureSetByPortalItem&lt;/STRONG&gt;&lt;SPAN&gt; function with the specifics of my data layer's portal, item id, layer id, and field I want to pull from, I just don't understand how I am supposed to implement it into the histogram code. My apologies if this seems like a silly question but as someone who is just barely starting to learn Arcade, anything helps!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 17:56:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1084524#M4874</guid>
      <dc:creator>AliciaAdiwidjaja</dc:creator>
      <dc:date>2021-07-30T17:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to show a range in a serial chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1084531#M4875</link>
      <description>&lt;P&gt;I forgot, using a for loop with a FeatureSet is a little different from an array. Let's assume that &lt;STRONG&gt;fs &lt;/STRONG&gt;in your case is a FeatureSet.. In that case, use the same code as before, but replace the big for loop with this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;for(var f in fs){
    if(f['some-attribute'] &amp;lt; 11){
        bins['0 to 10']['attributes']['count'] ++
    } else if(f['some-attribute'] &amp;lt; 21){
        bins['11 to 20']['attributes']['count'] ++
    } else if(f['some-attribute'] &amp;lt; 31){
        bins['21 to 30']['attributes']['count'] ++
    } else if(f['some-attribute'] &amp;lt; 41){
        bins['31 to 40']['attributes']['count'] ++
    } else if(f['some-attribute'] &amp;lt; 51){
        bins['41 to 50']['attributes']['count'] ++
    } else{
        bins['51 to 60']['attributes']['count'] ++
    }
}&lt;/LI-CODE&gt;&lt;P&gt;Where 'some-attribute' is the field name.&lt;/P&gt;&lt;P&gt;Also I just noticed I had my bins and conditions in opposing orders... I'll edit the original post.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 18:06:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1084531#M4875</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-07-30T18:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to show a range in a serial chart</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1089604#M4959</link>
      <description>&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;Yes I'm using Enterprise, I'll have a look at using a field calculation for it.&lt;/P&gt;&lt;P&gt;May thanks&lt;/P&gt;&lt;P&gt;Rachel&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 14:07:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/how-to-show-a-range-in-a-serial-chart/m-p/1089604#M4959</guid>
      <dc:creator>RachelS</dc:creator>
      <dc:date>2021-08-17T14:07:09Z</dc:date>
    </item>
  </channel>
</rss>

