4 Replies Latest reply on Jan 16, 2007 12:46 AM by Oddsy

    Flex Charting with a Web Service

    AHegedus Level 1
      I'm fairly new to flex and I'm trying to chart some data on a column chart and I'm having lots of trouble! I'm successfully getting this e4x data back from a web service:
      <getCDDDataResult xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns=" http://tempuri.org/" xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/">
      <dataPoint>
      <title>This Yr.</title>
      <point>0</point>
      </dataPoint>
      <dataPoint>
      <title>Last Yr.</title>
      <point>0</point>
      </dataPoint>
      <dataPoint>
      <title>3 Yr. Ave.</title>
      <point>0</point>
      </dataPoint>
      </getCDDDataResult>

      I want to display the chart when I change a numericstepper value, so I have this stepper:
      <mx:NumericStepper x="324" y="10" id="nsBalancePoint" minimum="50" maximum="70" value="55" enabled="true" change="gssdata.getCDDData.send()"/>

      which calls this function:
      private function updateCDDChart(event:ResultEvent):void
      {
      CDDchart.dataProvider(event.result.getCDDDataResult);
      }

      But I always get this error:
      TypeError: Error #1006: value is not a function.
      at TestApp/::updateCDDChart()
      at TestApp/___Operation3_result()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.rpc::AbstractOperation/ http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
      at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::resultHandler()
      at mx.rpc::Responder/result()
      at mx.rpc::AsyncRequest/acknowledge()
      at ::DirectHTTPMessageResponder/completeHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/flash.net:URLLoader::onComplete()


      Here is my chart code:
      <mx:ColumnChart width="80%" height="80%" showDataTips="true" id="CDDchart" horizontalCenter="9" verticalCenter="0">
      <mx:horizontalAxis>
      <mx:CategoryAxis title="Test" categoryField="point"/>
      </mx:horizontalAxis>
      <mx:series>
      <mx:Array>
      <mx:ColumnSeries yField="point" name="point"/>
      </mx:Array>
      </mx:series>
      </mx:ColumnChart>

      Can anyone see what I'm doing wrong???

      Thanks so much.

      A