<?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: Question regarding the chart widget. in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/question-regarding-the-chart-widget/m-p/363036#M8549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, I finally realized that the tool was taking my summaryField and was increasing it by a factor of 6.&amp;nbsp; Of course, I have no idea why, but as a quick fix I took the final line of code, and divided the summaryValue by 6.&amp;nbsp; Now it's reporting the correct number! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var msg:String = chartLabel + " [" + featureSet.features.length + " " + entitiesLabel + "]: " + numFormatter.format(summaryValue/6)&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This tool is great!&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doug&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Mar 2011 18:00:20 GMT</pubDate>
    <dc:creator>DougKampe</dc:creator>
    <dc:date>2011-03-15T18:00:20Z</dc:date>
    <item>
      <title>Question regarding the chart widget.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/question-regarding-the-chart-widget/m-p/363034#M8547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've successfully modified the chart widget for our organization's needs, but it has one minor quirk with it; when it displays the statistics results, it gives a nonsense value. Actually, I believe it is even doing it on the Flex interactive example: &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=51558a31b24a4139bf915a0ba47bd25d" rel="nofollow"&gt;http://www.arcgis.com/home/item.html?id=51558a31b24a4139bf915a0ba47bd25d&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, what should be happening is the widget sumarizes the bumber of features selected and the sum of a user-defined field &amp;lt;summaryfield&amp;gt;DRAIN_ACRES&amp;lt;/summaryfield&amp;gt; from the ChartWidget.xml. (Drain acres in my case.) The correct sum should be 370.327, but here is the result straight from the widget: "Total for selected area [1 features]: 2,221. (Again, actual is 370.327.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since I'm not a developer (I'm using Flex Builder 4 triall version since yesterday), and I am fruitlessly trying to figure this out, is there something in the code below that is causing this? I highlighted the bottom-most code below which populates the result string. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Doug&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS Server 9.3.1, Flex 2.2, ChartWidget 2.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;private function calculateStatistics(featureSet:FeatureSet):void&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;summaryValue = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for (var i:Number = 0; i &amp;lt; chartFields.length; i++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var chartFieldArray:Array = chartFields&lt;I&gt;.split(",");&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var chartValueArray: Array = [];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for (var j:Number = 0; j &amp;lt; chartFieldArray.length; j++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var label:String = chartFieldArray&lt;J&gt;;&lt;/J&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var value: Number = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for (var r:Number = 0; r &amp;lt; featureSet.features.length; r++) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;value += Number(featureSet.attributes&lt;R&gt;[label]);&lt;/R&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;summaryValue += Number(featureSet.attributes&lt;R&gt;[summaryField]);&lt;/R&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var obj:Object = new Object();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;obj.label = label;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;obj.value = value;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;chartValueArray.push(obj);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;chartSeries.push(chartValueArray);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ColumnChartStatistics.visible=false;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PieChartStatistics.visible=true;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PieChartStatistics.dataProvider = chartSeries[0];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;blue&amp;quot;;"&gt;var msg:String = chartLabel + " [" + featureSet.features.length + " " + entitiesLabel + "]: " + numFormatter.format(summaryValue);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 19:30:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/question-regarding-the-chart-widget/m-p/363034#M8547</guid>
      <dc:creator>DougKampe</dc:creator>
      <dc:date>2011-03-11T19:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding the chart widget.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/question-regarding-the-chart-widget/m-p/363035#M8548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Doug,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; I don't know what to tell you about your data but the data on the live site is working fine the summary field is POP2007 and when you use a point to select an individual "Census Block Group" the value in the summary is just the POP2007 value of that block and when you select more than one block than it correctly sums those POP2007 values.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Mar 2011 00:50:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/question-regarding-the-chart-widget/m-p/363035#M8548</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2011-03-12T00:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding the chart widget.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/question-regarding-the-chart-widget/m-p/363036#M8549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, I finally realized that the tool was taking my summaryField and was increasing it by a factor of 6.&amp;nbsp; Of course, I have no idea why, but as a quick fix I took the final line of code, and divided the summaryValue by 6.&amp;nbsp; Now it's reporting the correct number! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var msg:String = chartLabel + " [" + featureSet.features.length + " " + entitiesLabel + "]: " + numFormatter.format(summaryValue/6)&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This tool is great!&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doug&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 18:00:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/question-regarding-the-chart-widget/m-p/363036#M8549</guid>
      <dc:creator>DougKampe</dc:creator>
      <dc:date>2011-03-15T18:00:20Z</dc:date>
    </item>
  </channel>
</rss>

