<?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: adding two indications in the same serial/bar chart in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148838#M44637</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;it works, but after I click done, it gives me "no data" on the dashboard&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled5.png" style="width: 776px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35184i6F17AF6D08AE8FDB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled5.png" alt="Untitled5.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Feb 2022 22:16:13 GMT</pubDate>
    <dc:creator>Hala_Ghareeb</dc:creator>
    <dc:date>2022-02-28T22:16:13Z</dc:date>
    <item>
      <title>adding two indications in the same serial/bar chart</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148489#M44616</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a question about how to add two indications on the same serial chart: I want to combine the solved and the total number of features at the same chart.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="two line charts.png" style="width: 784px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35121i0B56D2EC086F6896/image-size/large?v=v2&amp;amp;px=999" role="button" title="two line charts.png" alt="two line charts.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 09:49:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148489#M44616</guid>
      <dc:creator>Hala_Ghareeb</dc:creator>
      <dc:date>2022-02-28T09:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: adding two indications in the same serial/bar chart</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148551#M44617</link>
      <description>&lt;P&gt;How is the data organized? There's no reason you shouldn't be able to do this, but it depends on where the data's coming from and what it looks like. Is "solved" a field?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 13:40:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148551#M44617</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-02-28T13:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: adding two indications in the same serial/bar chart</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148601#M44618</link>
      <description>&lt;P&gt;I have a layer for reports, and it has a field called "status" which contains values(received, processing, and solved).&lt;/P&gt;&lt;P&gt;I want to make a serial chart,&amp;nbsp; per day, for the solved features on a line and the total of all features(received, processing, and solved) on another line.&lt;/P&gt;&lt;P&gt;So I used a chart for grouped values by category "date", then split by the field "status", but this way did not give me the desired output.&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 28 Feb 2022 15:31:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148601#M44618</guid>
      <dc:creator>Hala_Ghareeb</dc:creator>
      <dc:date>2022-02-28T15:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: adding two indications in the same serial/bar chart</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148647#M44623</link>
      <description>&lt;P&gt;Well, you can use a &lt;STRONG&gt;Data Expression &lt;/STRONG&gt;to do this, too. Basically, you'd pull in the reports layer and throw them all into a "total" category, and then take the solved ones and add them &lt;EM&gt;again&lt;/EM&gt;. This should enable you to visualize the chart the way you'd like.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var portal = Portal('your portal url')

// Get reports featureset
var fs = FeatureSetByPortalItem(
    portal,
    'itemid of your service',
    0, // or whatever layer index the specific layer is at
    ['status', 'report_date'],
    false
)

// Output dictionary
var out_dict = {
    fields: [
        {name: 'type', type: 'esriFieldTypeString'},
        {name: 'report_date', type: 'esriFieldTypeDate'}
    ],
    geometryType: '',
    features: []
}

// Iterate over features
for (var f in fs){
    // Add feature to output dict as a "total" type
    Push(
        out_dict['features'],
        {
            attributes: {
                type: 'Total',
                report_date: Number(f['report_date']) // You need to cast the date as a number to be correctly interpreted
            }
        }
    )
    
    // If report is a "solved" type, add it again
    If (f['status'] == 'solved'){
        Push(
            out_dict['features'],
            {
                attributes: {
                    type: 'Solved',
                    report_date: Number(f['report_date']) // You need to cast the date as a number to be correctly interpreted
                }
            }
        )
    }
}

// Convert dict to FeatureSet
return FeatureSet(Text(out_dict))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used this expression with a sample FeatureSet that had the following records:&lt;/P&gt;&lt;TABLE border="1" width="50%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;Status&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;solved&lt;/TD&gt;&lt;TD width="50%"&gt;Today&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;solved&lt;/TD&gt;&lt;TD width="50%"&gt;Today&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;received&lt;/TD&gt;&lt;TD width="50%"&gt;Today&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;processing&lt;/TD&gt;&lt;TD width="50%"&gt;Today&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;solved&lt;/TD&gt;&lt;TD width="50%"&gt;Yesterday&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;received&lt;/TD&gt;&lt;TD width="50%"&gt;Yesterday&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;received&lt;/TD&gt;&lt;TD width="50%"&gt;Yesterday&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since "solved" records are added twice, the output FeatureSet had 10 records in it, and I was able to make this chart:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1646067695201.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35146i4835E94F8A1080F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1646067695201.png" alt="jcarlson_0-1646067695201.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 17:01:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148647#M44623</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-02-28T17:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: adding two indications in the same serial/bar chart</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148831#M44636</link>
      <description>&lt;P&gt;Thank you so much&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 22:11:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148831#M44636</guid>
      <dc:creator>Hala_Ghareeb</dc:creator>
      <dc:date>2022-02-28T22:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: adding two indications in the same serial/bar chart</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148838#M44637</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;it works, but after I click done, it gives me "no data" on the dashboard&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled5.png" style="width: 776px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/35184i6F17AF6D08AE8FDB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled5.png" alt="Untitled5.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 22:16:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148838#M44637</guid>
      <dc:creator>Hala_Ghareeb</dc:creator>
      <dc:date>2022-02-28T22:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: adding two indications in the same serial/bar chart</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148850#M44639</link>
      <description>&lt;P&gt;You mean it shows you the data when you're configuring the chart? Or it only shows it in the Expression Builder?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 22:35:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148850#M44639</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-02-28T22:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: adding two indications in the same serial/bar chart</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148875#M44640</link>
      <description>&lt;P&gt;&lt;SPAN&gt;it shows the data on the chart only while configuring the chart&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 07:06:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-two-indications-in-the-same-serial-bar/m-p/1148875#M44640</guid>
      <dc:creator>Hala_Ghareeb</dc:creator>
      <dc:date>2022-03-01T07:06:16Z</dc:date>
    </item>
  </channel>
</rss>

