1 Reply Latest reply on Mar 15, 2007 2:58 PM by csawall

    Using same returned data to create datagrid and pie graph

    csawall
      I am trying to find a good example or information on creating charts, initially pie graphs. I will be getting the data from a MySQL DB via a HTTPService call to a PHP script. I would like to use the same HTTPService call to make a datagrid and build a pie graph. My datagrid is working fine.

      All of the examples I have found show the app with an internal data source that's hard coded into an array ( http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDo cs_Parts&file=00001234.html). I did search this forum, but it seems most people are just looking for dynamic pie graphs and there isn't enough in the entries for me to go off of.

      The data returned to the MXML app looks like this:

      <auditdata>
      <riskdata>
      <core>core number here</core>
      <subcore>subcore number here</subcore>
      <mdata>mdata here</mdata>
      <risk1>number here</risk1>
      <risk2>number here</risk2>
      <risk3>number here</risk3>
      </riskdata>
      <riskdata>
      <core>core number here</core>
      <subcore>subcore number here</subcore>
      <mdata>mdata here</mdata>
      <risk1>number here</risk1>
      <risk2>number here</risk2>
      <risk3>number here</risk3>
      </riskdata>
      </auditdata>

      When the data is returned, everything under <riskdata> is put into a datagrid. What I'm looking to do in the pie graph is this.

      Create a 2 different pie graphs for each riskdata (there will only be 2). The first pie graph will be of the three "risks" (where their total number equals 100% of the graph). The second pie graph would be "core - subcore" and risk1 (where the two values total equals 100%of the graph). I hope that makes sense.

      Any guidance would be truly appreciated.

      Thanks,
      Chris