2 Replies Latest reply on Apr 3, 2007 7:33 PM by aaronc123

    Chart not displaying

    aaronc123
      Greetings

      I am modifying some the test drive examples to teach myself and I've run into an issue.

      I am working on a set of two charts, the top onw provides a summary, you click on an item and the bottm show the details.
      The top line chart is working fine, however, the lower chart is not. I can see the data being returned for the second chart, but it is never displayed.

      I've tried a few things and here is the current state of the code.

      Thanks

      Aaron


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
      <!-- creationComplete="{srv.getSalesTotal()}"> -->

      <mx:Object id="selectedMonth"/>
      <mx:SeriesInterpolate id="interpolate"/>

      <mx:Script><![CDATA[

      private function clickChart(o:Object):void {
      selectedMonth = o;
      fredChart.invalidateDisplayList();
      }
      ]]></mx:Script>


      <!-- <mx:HTTPService id="srv" url="results.xml"/> -->
      <mx:RemoteObject id="srv" destination="sales"/>
      <mx:Button label="Get Data" click="srv.getSalesTotal()" />

      <mx:Panel title="Revenue Timeline" width="100%" height="100%">
      <mx:LineChart dataProvider="{srv.getSalesTotal.lastResult}" width="100%" height="100%" showDataTips="true"
      itemClick="clickChart(event.hitData.item)">
      <!-- itemClick="selectedMonth = event.hitData.item" -->

      <mx:horizontalAxis>
      <mx:CategoryAxis categoryField="month"/>
      </mx:horizontalAxis>

      <mx:series>
      <mx:LineSeries yField="total"/>
      </mx:series>

      </mx:LineChart>
      </mx:Panel>

      <mx:Panel title="Product Breakdown" width="100%" height="100%">

      <mx:ColumnChart id="fredChart" dataProvider="{srv.getSalesByMonth(selectedMonth.month).lastResult}" width="100%" height="100%" showDataTips="true">

      <mx:horizontalAxis>
      <mx:CategoryAxis categoryField="product"/>
      </mx:horizontalAxis>

      <mx:series>
      <mx:ColumnSeries yField="total" showDataEffect="interpolate"/>
      </mx:series>

      </mx:ColumnChart>
      <mx:Legend dataProvider="{fredChart}"/>

      </mx:Panel>

      </mx:Application>