Help!!!!! Dynamically creating series in a chart

I am a newbie in Flex and I have been struggling with it for
a couple of days. I having failed to find anything that would help
me around in forums and tutorial so please help!
I need to create a chart with a variable number of lines. The
lines need to be configured from actionscript and need to have
their own dataProvider and formatting.
I have understood that I need to get to the chart.series
array and replace elements there with new elements or add elements.
I have not found correct interfaces to assign the type of the
series (line, bar, pie, etc) and the color of the stroke. Can
someone please help!!!
Here is the code that I have:
thisChart.series = new Array();
var oSeries:Series = new Series;
var oStroke:Stroke = new Stroke(0x000000, 1, .5);
oSeries.dataProvider = selectedMix;
oSeries.setStyle("stroke",oStroke);
thisChart.series.push(oSeries);

Hi Deeptika,
Thanks for you reply, Now I am Seeing a light at the end of
the TUNNEL. :).
Note: There is no need to specify the dataprovider for series
in mxml, cause we are adding dynamically in actionscript.
There is an error in my code. Attached the correct code with
this message, run in debug mode and watch the values of
tmpArray and
sArray. To run in debug mode place a break point by pressing
Ctrl+Shift+b and press F11. Watch the variable in Expressions
window. F6 step over and F8 refresh. waiting for your reply.
i can explain u clearly the requirement, just send me a test
mail to this id [email protected] i will send u sample
chart image so that u can understand the requirement.

Similar Messages

  • Inventory forecast help - dynamically creating formulas?

    Post Author: ddenise
    CA Forum: Formula
    I am writing a report that reconciles sales orders to inventory - essentially, group sales orders by the scheduled production date, list out all the parts that are needed and forecast the impact on inventory, highlighting any areas where inventory is foretasted to go negative. The results right now look like this:                               Part          In Inventory          Needed         Inventory RemainingOrder Number 567     Product Number 311187          Part Number 8111234          100                  5                  95          Part Number 8111235      Product Number 311189          Part Number 8111234          100                 6                  94
              Part Number 8112235 You can see the problem is that once I calculate "Inventory Remaining", the next instance of part 8111234, should have an "In Inventory" value of 95, NOT 100, but 100 is what is stored in the database.  The next time that part number is used, the database value is pulled and 100 is displayed.  A running total or summary won't work because they cannot be used on 2nd pass formulas/variables; "Inventory Remaining" is a formula evaluated on the 2nd pass.The result that I NEED to come out would be:                                Part          In Inventory          Needed         Inventory Remaining
    Order Number 567
         Product Number 311187
              Part Number 8111234          100                  5                  95
              Part Number 8111235
          Product Number 311189
              Part Number 8111234          95                  6                  89
              Part Number 8112235  So.... I am thinking that I need to create a formula that does the following while records are printed:Check to see if a variable whose name is equal to the part number that is being printed (in this case "8111234") and if it doesn't exist, then create it, setting it's value to what is in the database (in this case "100")Use the variable's current value, subtract the quantity of those parts that are needed for the current record being printed and updated the variable's value to this difference.If the variable does already exisit, then use it's current value to display in the "In Inventory" column and,Use the variable's current value, subtract the quantity of those parts
    that are needed for the current record being printed and updated the
    variable's value to this difference.What this would do is essentially, dynamically create variables that can be used for display and other evaluation and update the particular variable that is related to the part number that is being printed. Has anyone done anything like this before?  I'm sure I'm not the first to encounter this situation.  Also, if there are other ways to solve this problem that Crystal can handle, please advice - I cannot seem to find any other solution. Regards,  

    XtrmeMelissa wrote:
    Haha! I got all the formulas down except for the boxes but thank you so much!
    I do have a new problem that just arrived, how can I get it to clear itself after I'm finished? So that it acts like a calculator and the columns are automatically cleared and the bars on hand turns into the total bars amount?
    It sounds very difficult
    Melissa
    Message was edited by: XtrmeMelissa, sorry about this! Boss brought up something new
    Melissa,
    I anticipated that problem and that's why I proposed the structure that I did.
    Good luck,
    Jerry

  • Dynamically Add Series to a flex chart

    Hello,
    Does any one know how to dynamically add series to an areachart? I'm trying to create a dashboard with this kind of chart http://www.meutzner.com/blog/attachments/360/Flex_Finance_Step5.html  but with multiple series. I have the xml like this..and I need to use the kwhsavs as the data points..
    I know I have to do it in the result handler..can someone help me out?.....thanks in advance.
             * Called when HTTPService call completes the data load of the XML chart info.
                private function dataResult(event:ResultEvent):void
                     var tmpData:ArrayCollection = event.result.root.program;
                     for each (var item in tmpData)
                             // Here new series here...
    <?xml version="1.0" encoding="utf-8"?>
    <root>
      <program programName="Series 1">
        <totkwhsavs date="2008-01-03" kwhsavs="47632.3200" />
        <totkwhsavs date="2008-01-04" kwhsavs="51418.5600" />
        <totkwhsavs date="2008-01-07" kwhsavs="170604.4800" />
        <totkwhsavs date="2008-01-08" kwhsavs="32632.3200" />
        <totkwhsavs date="2008-01-09" kwhsavs="61200.9600" />
        <totkwhsavs date="2008-01-10" kwhsavs="79312.3200" />
        <totkwhsavs date="2008-01-11" kwhsavs="35648.6400" />
        <totkwhsavs date="2008-01-14" kwhsavs="17688.9600" />
        <totkwhsavs date="2008-01-15" kwhsavs="37404.4800" />
        <totkwhsavs date="2008-01-16" kwhsavs="15341.7600" />
        <totkwhsavs date="2008-01-17" kwhsavs="107674.5600" />
        <totkwhsavs date="2008-01-18" kwhsavs="24521.6000" />
        <totkwhsavs date="2008-01-21" kwhsavs="6541.4400" />
        <totkwhsavs date="2008-01-22" kwhsavs="33707.5200" />
        <totkwhsavs date="2008-01-23" kwhsavs="48791.0400" />
        <totkwhsavs date="2008-01-24" kwhsavs="70316.1600" />
        <totkwhsavs date="2008-01-25" kwhsavs="37237.7600" />
        <totkwhsavs date="2008-01-28" kwhsavs="5273.2800" />
        <totkwhsavs date="2008-01-29" kwhsavs="51608.6400" />
        <totkwhsavs date="2008-01-30" kwhsavs="273521.2800" />
        <totkwhsavs date="2008-01-31" kwhsavs="262619.5200" />
        <totkwhsavs date="2008-02-01" kwhsavs="336914.8800" />
        <totkwhsavs date="2008-02-04" kwhsavs="126445.4400" />
        <totkwhsavs date="2008-02-05" kwhsavs="372644.1600" />
        <totkwhsavs date="2008-02-06" kwhsavs="157114.5600" />
        <totkwhsavs date="2008-02-07" kwhsavs="74941.4400" />
        <totkwhsavs date="2008-02-08" kwhsavs="36904.3200" />
        <totkwhsavs date="2008-02-11" kwhsavs="20378.8800" />
        <totkwhsavs date="2008-02-12" kwhsavs="31257.6000" />
        <totkwhsavs date="2008-02-13" kwhsavs="224701.4400" />
        <totkwhsavs date="2008-02-14" kwhsavs="229971.8400" />
        <totkwhsavs date="2008-02-15" kwhsavs="82936.3200" />
        <totkwhsavs date="2008-02-19" kwhsavs="71586.5600" />
        <totkwhsavs date="2008-02-20" kwhsavs="45050.8800" />
        <totkwhsavs date="2008-02-21" kwhsavs="399826.5600" />
        <totkwhsavs date="2008-02-22" kwhsavs="86696.9600" />
        <totkwhsavs date="2008-02-25" kwhsavs="174406.0800" />
        <totkwhsavs date="2008-02-28" kwhsavs="52768.0000" />
        <totkwhsavs date="2008-03-04" kwhsavs="216846.7200" />
        <totkwhsavs date="2008-03-05" kwhsavs="205426.5600" />
        <totkwhsavs date="2008-03-06" kwhsavs="81350.4000" />
        <totkwhsavs date="2008-03-07" kwhsavs="75051.8400" />
        <totkwhsavs date="2008-03-13" kwhsavs="8718.7200" />
        <totkwhsavs date="2008-03-14" kwhsavs="8397.1200" />
        <totkwhsavs date="2008-03-17" kwhsavs="185443.2000" />
        <totkwhsavs date="2008-03-20" kwhsavs="6000.0000" />
        <totkwhsavs date="2008-03-24" kwhsavs="5782.0800" />
        <totkwhsavs date="2008-03-26" kwhsavs="75034.5600" />
        <totkwhsavs date="2008-03-27" kwhsavs="159776.6400" />
        <totkwhsavs date="2008-03-31" kwhsavs="1143795.8400" />
        <totkwhsavs date="2008-04-01" kwhsavs="52963.2000" />
        <totkwhsavs date="2008-04-08" kwhsavs="4000.0000" />
        <totkwhsavs date="2008-04-25" kwhsavs="50015.0400" />
        <totkwhsavs date="2008-05-08" kwhsavs="440999.0400" />
        <totkwhsavs date="2008-05-27" kwhsavs="7856.6400" />
        <totkwhsavs date="2008-05-28" kwhsavs="999.3600" />
        <totkwhsavs date="2008-06-02" kwhsavs="83316.4800" />
        <totkwhsavs date="2008-06-03" kwhsavs="14005.4400" />
        <totkwhsavs date="2008-06-04" kwhsavs="113183.0400" />
        <totkwhsavs date="2008-06-23" kwhsavs="6055.6800" />
        <totkwhsavs date="2008-06-26" kwhsavs="55369.9200" />
        <totkwhsavs date="2008-07-08" kwhsavs="105760.3200" />
        <totkwhsavs date="2008-07-11" kwhsavs="167619.8400" />
        <totkwhsavs date="2008-07-17" kwhsavs="113564.1600" />
        <totkwhsavs date="2008-07-18" kwhsavs="23229.1200" />
        <totkwhsavs date="2008-07-30" kwhsavs="49492.8000" />
        <totkwhsavs date="2008-08-02" kwhsavs="111351.3600" />
        <totkwhsavs date="2008-08-08" kwhsavs="167619.8400" />
        <totkwhsavs date="2008-08-12" kwhsavs="2707.2000" />
        <totkwhsavs date="2008-08-26" kwhsavs="191064.9600" />
        <totkwhsavs date="2008-08-27" kwhsavs="3519.3600" />
        <totkwhsavs date="2008-08-29" kwhsavs="18752.6400" />
        <totkwhsavs date="2008-09-02" kwhsavs="22167.3600" />
        <totkwhsavs date="2008-09-04" kwhsavs="1082.8800" />
        <totkwhsavs date="2008-09-05" kwhsavs="587137.9200" />
        <totkwhsavs date="2008-09-09" kwhsavs="33824.6400" />
        <totkwhsavs date="2008-09-16" kwhsavs="22167.3600" />
        <totkwhsavs date="2008-09-17" kwhsavs="17763.8400" />
        <totkwhsavs date="2008-09-19" kwhsavs="8674.5600" />
        <totkwhsavs date="2008-09-24" kwhsavs="53396.1600" />
        <totkwhsavs date="2008-09-25" kwhsavs="10428.4800" />
        <totkwhsavs date="2008-10-01" kwhsavs="61750.0800" />
        <totkwhsavs date="2008-10-02" kwhsavs="107643.8400" />
        <totkwhsavs date="2008-10-03" kwhsavs="47462.4000" />
        <totkwhsavs date="2008-10-06" kwhsavs="4005.1200" />
        <totkwhsavs date="2008-10-07" kwhsavs="39736.3200" />
        <totkwhsavs date="2008-10-09" kwhsavs="9152.6400" />
        <totkwhsavs date="2008-10-10" kwhsavs="2616.0000" />
        <totkwhsavs date="2008-10-13" kwhsavs="8268.4800" />
        <totkwhsavs date="2008-10-14" kwhsavs="138812.1600" />
        <totkwhsavs date="2008-10-15" kwhsavs="28195.2000" />
        <totkwhsavs date="2008-10-17" kwhsavs="175518.7200" />
        <totkwhsavs date="2008-10-22" kwhsavs="37278.7200" />
        <totkwhsavs date="2008-10-28" kwhsavs="33956.1600" />
        <totkwhsavs date="2008-10-29" kwhsavs="17937.6000" />
        <totkwhsavs date="2008-10-30" kwhsavs="264252.4800" />
        <totkwhsavs date="2008-10-31" kwhsavs="9727.6800" />
        <totkwhsavs date="2008-11-03" kwhsavs="51020.1600" />
        <totkwhsavs date="2008-11-20" kwhsavs="5414.4000" />
        <totkwhsavs date="2008-11-21" kwhsavs="14672.6400" />
        <totkwhsavs date="2008-11-25" kwhsavs="5414.4000" />
        <totkwhsavs date="2008-12-01" kwhsavs="2165.7600" />
        <totkwhsavs date="2008-12-03" kwhsavs="10558.0800" />
        <totkwhsavs date="2008-12-05" kwhsavs="292814.4000" />
        <totkwhsavs date="2008-12-08" kwhsavs="342307.2000" />
        <totkwhsavs date="2008-12-09" kwhsavs="2707.2000" />
        <totkwhsavs date="2008-12-11" kwhsavs="4005.1200" />
        <totkwhsavs date="2008-12-16" kwhsavs="108993.6000" />
        <totkwhsavs date="2008-12-17" kwhsavs="7841.2800" />
        <totkwhsavs date="2008-12-18" kwhsavs="206042.8800" />
        <totkwhsavs date="2008-12-19" kwhsavs="163659.8400" />
        <totkwhsavs date="2008-12-22" kwhsavs="97653.1200" />
        <totkwhsavs date="2008-12-23" kwhsavs="161386.5600" />
        <totkwhsavs date="2008-12-26" kwhsavs="525004.8000" />
        <totkwhsavs date="2008-12-27" kwhsavs="95824.3200" />
        <totkwhsavs date="2008-12-29" kwhsavs="280452.4800" />
        <totkwhsavs date="2008-12-30" kwhsavs="442554.2400" />
        <totkwhsavs date="2008-12-31" kwhsavs="4610.8800" />
      </program>
      <program programName="Series 2">
        <totkwhsavs date="2008-07-01" kwhsavs="5283.9000" />
        <totkwhsavs date="2008-07-23" kwhsavs="17469.5700" />
        <totkwhsavs date="2008-07-30" kwhsavs="22569.0800" />
        <totkwhsavs date="2008-07-31" kwhsavs="13742.0100" />
        <totkwhsavs date="2008-08-01" kwhsavs="36402.7500" />
        <totkwhsavs date="2008-08-02" kwhsavs="61254.7100" />
        <totkwhsavs date="2008-08-18" kwhsavs="9888.1200" />
        <totkwhsavs date="2008-08-19" kwhsavs="30139.8300" />
        <totkwhsavs date="2008-08-20" kwhsavs="52721.6500" />
        <totkwhsavs date="2008-08-21" kwhsavs="5217.2100" />
        <totkwhsavs date="2008-08-25" kwhsavs="163535.8300" />
        <totkwhsavs date="2008-09-03" kwhsavs="18812.8000" />
        <totkwhsavs date="2008-09-04" kwhsavs="87868.2000" />
        <totkwhsavs date="2008-09-05" kwhsavs="65277.9300" />
        <totkwhsavs date="2008-09-09" kwhsavs="40875.8200" />
        <totkwhsavs date="2008-09-11" kwhsavs="64145.5300" />
        <totkwhsavs date="2008-09-12" kwhsavs="2064.9600" />
        <totkwhsavs date="2008-09-16" kwhsavs="7529.4100" />
        <totkwhsavs date="2008-09-17" kwhsavs="3012.8600" />
        <totkwhsavs date="2008-09-19" kwhsavs="21610.4900" />
        <totkwhsavs date="2008-09-20" kwhsavs="6932.5400" />
        <totkwhsavs date="2008-09-22" kwhsavs="7721.2100" />
        <totkwhsavs date="2008-09-23" kwhsavs="40967.6000" />
        <totkwhsavs date="2008-09-24" kwhsavs="75629.6900" />
        <totkwhsavs date="2008-09-25" kwhsavs="3022.6500" />
        <totkwhsavs date="2008-09-26" kwhsavs="85524.6500" />
        <totkwhsavs date="2008-09-27" kwhsavs="54166.3200" />
        <totkwhsavs date="2008-10-01" kwhsavs="87857.8100" />
        <totkwhsavs date="2008-10-02" kwhsavs="44671.7400" />
        <totkwhsavs date="2008-10-03" kwhsavs="28834.2800" />
        <totkwhsavs date="2008-10-06" kwhsavs="91743.7100" />
        <totkwhsavs date="2008-10-07" kwhsavs="20846.7800" />
        <totkwhsavs date="2008-10-08" kwhsavs="72984.9000" />
        <totkwhsavs date="2008-10-09" kwhsavs="107800.3700" />
        <totkwhsavs date="2008-10-10" kwhsavs="35978.6200" />
        <totkwhsavs date="2008-10-13" kwhsavs="13388.2900" />
        <totkwhsavs date="2008-10-14" kwhsavs="117283.5600" />
        <totkwhsavs date="2008-10-15" kwhsavs="26121.6000" />
        <totkwhsavs date="2008-10-16" kwhsavs="4479.6800" />
        <totkwhsavs date="2008-10-20" kwhsavs="12263.6000" />
        <totkwhsavs date="2008-10-21" kwhsavs="10964.9100" />
        <totkwhsavs date="2008-10-22" kwhsavs="17431.6800" />
        <totkwhsavs date="2008-10-29" kwhsavs="11556.2800" />
        <totkwhsavs date="2008-10-30" kwhsavs="17684.6600" />
        <totkwhsavs date="2008-10-31" kwhsavs="15702.8400" />
        <totkwhsavs date="2008-11-04" kwhsavs="53668.5300" />
        <totkwhsavs date="2008-11-05" kwhsavs="52350.2000" />
        <totkwhsavs date="2008-11-06" kwhsavs="57828.7900" />
        <totkwhsavs date="2008-11-11" kwhsavs="31006.9100" />
        <totkwhsavs date="2008-11-13" kwhsavs="48291.9000" />
        <totkwhsavs date="2008-11-20" kwhsavs="78897.6500" />
        <totkwhsavs date="2008-11-24" kwhsavs="23127.2300" />
        <totkwhsavs date="2008-11-25" kwhsavs="78861.3600" />
        <totkwhsavs date="2008-11-26" kwhsavs="11158.7800" />
        <totkwhsavs date="2008-12-01" kwhsavs="25061.2300" />
        <totkwhsavs date="2008-12-03" kwhsavs="25387.5800" />
        <totkwhsavs date="2008-12-04" kwhsavs="39855.6600" />
        <totkwhsavs date="2008-12-05" kwhsavs="10968.9500" />
        <totkwhsavs date="2008-12-16" kwhsavs="17024.3800" />
        <totkwhsavs date="2008-12-19" kwhsavs="35257.8500" />
      </program>
      <program programName="Series 3">
        <totkwhsavs date="2008-09-29" kwhsavs="33088.1500" />
        <totkwhsavs date="2008-09-30" kwhsavs="22931.1500" />
        <totkwhsavs date="2008-10-01" kwhsavs="56942.0000" />
        <totkwhsavs date="2008-10-02" kwhsavs="26399.0000" />
        <totkwhsavs date="2008-10-03" kwhsavs="26060.4500" />
        <totkwhsavs date="2008-10-06" kwhsavs="25107.6000" />
        <totkwhsavs date="2008-10-07" kwhsavs="40643.3900" />
        <totkwhsavs date="2008-10-08" kwhsavs="79733.4300" />
        <totkwhsavs date="2008-10-09" kwhsavs="62522.1000" />
        <totkwhsavs date="2008-10-10" kwhsavs="39355.0000" />
        <totkwhsavs date="2008-10-13" kwhsavs="128959.1700" />
        <totkwhsavs date="2008-10-14" kwhsavs="70101.0600" />
        <totkwhsavs date="2008-10-15" kwhsavs="38892.3700" />
        <totkwhsavs date="2008-10-16" kwhsavs="64203.1500" />
        <totkwhsavs date="2008-10-17" kwhsavs="70063.9100" />
        <totkwhsavs date="2008-10-18" kwhsavs="23487.7900" />
        <totkwhsavs date="2008-10-20" kwhsavs="93303.6400" />
        <totkwhsavs date="2008-10-21" kwhsavs="132008.0000" />
        <totkwhsavs date="2008-10-22" kwhsavs="73830.8600" />
        <totkwhsavs date="2008-10-23" kwhsavs="21890.0000" />
        <totkwhsavs date="2008-10-24" kwhsavs="40209.0000" />
        <totkwhsavs date="2008-10-28" kwhsavs="35039.6600" />
        <totkwhsavs date="2008-10-29" kwhsavs="148992.5000" />
        <totkwhsavs date="2008-10-30" kwhsavs="62943.6000" />
        <totkwhsavs date="2008-10-31" kwhsavs="57227.5000" />
        <totkwhsavs date="2008-11-03" kwhsavs="6973.7500" />
        <totkwhsavs date="2008-11-04" kwhsavs="3172.0000" />
        <totkwhsavs date="2008-11-05" kwhsavs="107385.5100" />
        <totkwhsavs date="2008-11-06" kwhsavs="95859.0000" />
        <totkwhsavs date="2008-11-07" kwhsavs="23940.0000" />
        <totkwhsavs date="2008-11-08" kwhsavs="2256.0000" />
        <totkwhsavs date="2008-11-12" kwhsavs="54702.0000" />
        <totkwhsavs date="2008-11-13" kwhsavs="37358.1500" />
        <totkwhsavs date="2008-11-14" kwhsavs="23471.6000" />
        <totkwhsavs date="2008-11-17" kwhsavs="146144.9000" />
        <totkwhsavs date="2008-11-21" kwhsavs="63987.7800" />
        <totkwhsavs date="2008-11-24" kwhsavs="66608.7100" />
        <totkwhsavs date="2008-11-25" kwhsavs="51839.6200" />
        <totkwhsavs date="2008-11-26" kwhsavs="25777.0950" />
        <totkwhsavs date="2008-12-01" kwhsavs="37789.4200" />
        <totkwhsavs date="2008-12-02" kwhsavs="25056.3000" />
        <totkwhsavs date="2008-12-03" kwhsavs="36452.6500" />
        <totkwhsavs date="2008-12-04" kwhsavs="30799.7500" />
        <totkwhsavs date="2008-12-05" kwhsavs="21878.9100" />
        <totkwhsavs date="2008-12-06" kwhsavs="18583.0000" />
        <totkwhsavs date="2008-12-08" kwhsavs="25552.6400" />
        <totkwhsavs date="2008-12-09" kwhsavs="97217.9900" />
        <totkwhsavs date="2008-12-10" kwhsavs="84285.9600" />
        <totkwhsavs date="2008-12-11" kwhsavs="29488.8000" />
        <totkwhsavs date="2008-12-12" kwhsavs="13433.6300" />
      </program>
      <program programName="Series 4">
        <totkwhsavs date="2008-01-10" kwhsavs="192711.6750" />
        <totkwhsavs date="2008-01-16" kwhsavs="47435.5450" />
        <totkwhsavs date="2008-01-25" kwhsavs="42353.9250" />
        <totkwhsavs date="2008-01-29" kwhsavs="97847.8450" />
        <totkwhsavs date="2008-02-06" kwhsavs="106005.5750" />
        <totkwhsavs date="2008-02-07" kwhsavs="100189.7250" />
        <totkwhsavs date="2008-02-08" kwhsavs="67175.9400" />
        <totkwhsavs date="2008-02-18" kwhsavs="47212.8100" />
        <totkwhsavs date="2008-02-19" kwhsavs="47212.8100" />
        <totkwhsavs date="2008-02-27" kwhsavs="41060.1700" />
        <totkwhsavs date="2008-03-18" kwhsavs="160624.4700" />
        <totkwhsavs date="2008-03-20" kwhsavs="190567.2250" />
        <totkwhsavs date="2008-03-31" kwhsavs="113977.6800" />
        <totkwhsavs date="2008-04-09" kwhsavs="113977.6800" />
        <totkwhsavs date="2008-04-10" kwhsavs="122362.9500" />
        <totkwhsavs date="2008-04-15" kwhsavs="1154678.0460" />
        <totkwhsavs date="2008-04-28" kwhsavs="373095.0400" />
        <totkwhsavs date="2008-05-01" kwhsavs="179670.3000" />
        <totkwhsavs date="2008-05-02" kwhsavs="179670.3000" />
        <totkwhsavs date="2008-06-27" kwhsavs="987469.3110" />
        <totkwhsavs date="2008-06-30" kwhsavs="619132.6150" />
        <totkwhsavs date="2008-07-04" kwhsavs="99837.4600" />
        <totkwhsavs date="2008-07-11" kwhsavs="35544.5500" />
        <totkwhsavs date="2008-07-15" kwhsavs="142191.3850" />
        <totkwhsavs date="2008-07-16" kwhsavs="267963.6250" />
        <totkwhsavs date="2008-07-17" kwhsavs="179670.3000" />
        <totkwhsavs date="2008-07-18" kwhsavs="181073.0250" />
        <totkwhsavs date="2008-07-21" kwhsavs="100189.7250" />
        <totkwhsavs date="2008-07-23" kwhsavs="285445.3350" />
        <totkwhsavs date="2008-07-25" kwhsavs="85032.5900" />
        <totkwhsavs date="2008-07-31" kwhsavs="190181.5650" />
        <totkwhsavs date="2008-08-01" kwhsavs="66917.1450" />
        <totkwhsavs date="2008-08-02" kwhsavs="50481.8250" />
        <totkwhsavs date="2008-08-04" kwhsavs="101596.6100" />
        <totkwhsavs date="2008-08-14" kwhsavs="82165.2600" />
        <totkwhsavs date="2008-08-15" kwhsavs="41948.9950" />
        <totkwhsavs date="2008-08-19" kwhsavs="517683.2010" />
        <totkwhsavs date="2008-08-21" kwhsavs="59952.7930" />
        <totkwhsavs date="2008-08-22" kwhsavs="517683.2010" />
        <totkwhsavs date="2008-08-29" kwhsavs="115995.9250" />
        <totkwhsavs date="2008-09-22" kwhsavs="1363410.4460" />
        <totkwhsavs date="2008-09-23" kwhsavs="130221.7600" />
        <totkwhsavs date="2008-09-24" kwhsavs="82165.2600" />
        <totkwhsavs date="2008-09-25" kwhsavs="70834.1000" />
        <totkwhsavs date="2008-09-29" kwhsavs="313580.8270" />
        <totkwhsavs date="2008-09-30" kwhsavs="41948.9950" />
        <totkwhsavs date="2008-10-01" kwhsavs="120869.1520" />
        <totkwhsavs date="2008-10-08" kwhsavs="41575.7350" />
        <totkwhsavs date="2008-10-23" kwhsavs="27624.5000" />
        <totkwhsavs date="2008-11-05" kwhsavs="121396.2650" />
        <totkwhsavs date="2008-11-06" kwhsavs="120869.1520" />
        <totkwhsavs date="2008-11-07" kwhsavs="70834.1000" />
        <totkwhsavs date="2008-11-11" kwhsavs="1037228.5230" />
        <totkwhsavs date="2008-11-12" kwhsavs="584143.5000" />
        <totkwhsavs date="2008-11-14" kwhsavs="138229.3520" />
        <totkwhsavs date="2008-11-17" kwhsavs="382103.4810" />
        <totkwhsavs date="2008-11-20" kwhsavs="339721.4770" />
        <totkwhsavs date="2008-11-24" kwhsavs="211180.9280" />
      </program>
    </root>

    Hello,
    Does any one know how to dynamically add series to an areachart? I'm trying to create a dashboard with this kind of chart http://www.meutzner.com/blog/attachments/360/Flex_Finance_Step5.html  but with multiple series. I have the xml like this..and I need to use the kwhsavs as the data points..
    I know I have to do it in the result handler..can someone help me out?.....thanks in advance.
             * Called when HTTPService call completes the data load of the XML chart info.
                private function dataResult(event:ResultEvent):void
                     var tmpData:ArrayCollection = event.result.root.program;
                     for each (var item in tmpData)
                             // Here new series here...
    <?xml version="1.0" encoding="utf-8"?>
    <root>
      <program programName="Series 1">
        <totkwhsavs date="2008-01-03" kwhsavs="47632.3200" />
        <totkwhsavs date="2008-01-04" kwhsavs="51418.5600" />
        <totkwhsavs date="2008-01-07" kwhsavs="170604.4800" />
        <totkwhsavs date="2008-01-08" kwhsavs="32632.3200" />
        <totkwhsavs date="2008-01-09" kwhsavs="61200.9600" />
        <totkwhsavs date="2008-01-10" kwhsavs="79312.3200" />
        <totkwhsavs date="2008-01-11" kwhsavs="35648.6400" />
        <totkwhsavs date="2008-01-14" kwhsavs="17688.9600" />
        <totkwhsavs date="2008-01-15" kwhsavs="37404.4800" />
        <totkwhsavs date="2008-01-16" kwhsavs="15341.7600" />
        <totkwhsavs date="2008-01-17" kwhsavs="107674.5600" />
        <totkwhsavs date="2008-01-18" kwhsavs="24521.6000" />
        <totkwhsavs date="2008-01-21" kwhsavs="6541.4400" />
        <totkwhsavs date="2008-01-22" kwhsavs="33707.5200" />
        <totkwhsavs date="2008-01-23" kwhsavs="48791.0400" />
        <totkwhsavs date="2008-01-24" kwhsavs="70316.1600" />
        <totkwhsavs date="2008-01-25" kwhsavs="37237.7600" />
        <totkwhsavs date="2008-01-28" kwhsavs="5273.2800" />
        <totkwhsavs date="2008-01-29" kwhsavs="51608.6400" />
        <totkwhsavs date="2008-01-30" kwhsavs="273521.2800" />
        <totkwhsavs date="2008-01-31" kwhsavs="262619.5200" />
        <totkwhsavs date="2008-02-01" kwhsavs="336914.8800" />
        <totkwhsavs date="2008-02-04" kwhsavs="126445.4400" />
        <totkwhsavs date="2008-02-05" kwhsavs="372644.1600" />
        <totkwhsavs date="2008-02-06" kwhsavs="157114.5600" />
        <totkwhsavs date="2008-02-07" kwhsavs="74941.4400" />
        <totkwhsavs date="2008-02-08" kwhsavs="36904.3200" />
        <totkwhsavs date="2008-02-11" kwhsavs="20378.8800" />
        <totkwhsavs date="2008-02-12" kwhsavs="31257.6000" />
        <totkwhsavs date="2008-02-13" kwhsavs="224701.4400" />
        <totkwhsavs date="2008-02-14" kwhsavs="229971.8400" />
        <totkwhsavs date="2008-02-15" kwhsavs="82936.3200" />
        <totkwhsavs date="2008-02-19" kwhsavs="71586.5600" />
        <totkwhsavs date="2008-02-20" kwhsavs="45050.8800" />
        <totkwhsavs date="2008-02-21" kwhsavs="399826.5600" />
        <totkwhsavs date="2008-02-22" kwhsavs="86696.9600" />
        <totkwhsavs date="2008-02-25" kwhsavs="174406.0800" />
        <totkwhsavs date="2008-02-28" kwhsavs="52768.0000" />
        <totkwhsavs date="2008-03-04" kwhsavs="216846.7200" />
        <totkwhsavs date="2008-03-05" kwhsavs="205426.5600" />
        <totkwhsavs date="2008-03-06" kwhsavs="81350.4000" />
        <totkwhsavs date="2008-03-07" kwhsavs="75051.8400" />
        <totkwhsavs date="2008-03-13" kwhsavs="8718.7200" />
        <totkwhsavs date="2008-03-14" kwhsavs="8397.1200" />
        <totkwhsavs date="2008-03-17" kwhsavs="185443.2000" />
        <totkwhsavs date="2008-03-20" kwhsavs="6000.0000" />
        <totkwhsavs date="2008-03-24" kwhsavs="5782.0800" />
        <totkwhsavs date="2008-03-26" kwhsavs="75034.5600" />
        <totkwhsavs date="2008-03-27" kwhsavs="159776.6400" />
        <totkwhsavs date="2008-03-31" kwhsavs="1143795.8400" />
        <totkwhsavs date="2008-04-01" kwhsavs="52963.2000" />
        <totkwhsavs date="2008-04-08" kwhsavs="4000.0000" />
        <totkwhsavs date="2008-04-25" kwhsavs="50015.0400" />
        <totkwhsavs date="2008-05-08" kwhsavs="440999.0400" />
        <totkwhsavs date="2008-05-27" kwhsavs="7856.6400" />
        <totkwhsavs date="2008-05-28" kwhsavs="999.3600" />
        <totkwhsavs date="2008-06-02" kwhsavs="83316.4800" />
        <totkwhsavs date="2008-06-03" kwhsavs="14005.4400" />
        <totkwhsavs date="2008-06-04" kwhsavs="113183.0400" />
        <totkwhsavs date="2008-06-23" kwhsavs="6055.6800" />
        <totkwhsavs date="2008-06-26" kwhsavs="55369.9200" />
        <totkwhsavs date="2008-07-08" kwhsavs="105760.3200" />
        <totkwhsavs date="2008-07-11" kwhsavs="167619.8400" />
        <totkwhsavs date="2008-07-17" kwhsavs="113564.1600" />
        <totkwhsavs date="2008-07-18" kwhsavs="23229.1200" />
        <totkwhsavs date="2008-07-30" kwhsavs="49492.8000" />
        <totkwhsavs date="2008-08-02" kwhsavs="111351.3600" />
        <totkwhsavs date="2008-08-08" kwhsavs="167619.8400" />
        <totkwhsavs date="2008-08-12" kwhsavs="2707.2000" />
        <totkwhsavs date="2008-08-26" kwhsavs="191064.9600" />
        <totkwhsavs date="2008-08-27" kwhsavs="3519.3600" />
        <totkwhsavs date="2008-08-29" kwhsavs="18752.6400" />
        <totkwhsavs date="2008-09-02" kwhsavs="22167.3600" />
        <totkwhsavs date="2008-09-04" kwhsavs="1082.8800" />
        <totkwhsavs date="2008-09-05" kwhsavs="587137.9200" />
        <totkwhsavs date="2008-09-09" kwhsavs="33824.6400" />
        <totkwhsavs date="2008-09-16" kwhsavs="22167.3600" />
        <totkwhsavs date="2008-09-17" kwhsavs="17763.8400" />
        <totkwhsavs date="2008-09-19" kwhsavs="8674.5600" />
        <totkwhsavs date="2008-09-24" kwhsavs="53396.1600" />
        <totkwhsavs date="2008-09-25" kwhsavs="10428.4800" />
        <totkwhsavs date="2008-10-01" kwhsavs="61750.0800" />
        <totkwhsavs date="2008-10-02" kwhsavs="107643.8400" />
        <totkwhsavs date="2008-10-03" kwhsavs="47462.4000" />
        <totkwhsavs date="2008-10-06" kwhsavs="4005.1200" />
        <totkwhsavs date="2008-10-07" kwhsavs="39736.3200" />
        <totkwhsavs date="2008-10-09" kwhsavs="9152.6400" />
        <totkwhsavs date="2008-10-10" kwhsavs="2616.0000" />
        <totkwhsavs date="2008-10-13" kwhsavs="8268.4800" />
        <totkwhsavs date="2008-10-14" kwhsavs="138812.1600" />
        <totkwhsavs date="2008-10-15" kwhsavs="28195.2000" />
        <totkwhsavs date="2008-10-17" kwhsavs="175518.7200" />
        <totkwhsavs date="2008-10-22" kwhsavs="37278.7200" />
        <totkwhsavs date="2008-10-28" kwhsavs="33956.1600" />
        <totkwhsavs date="2008-10-29" kwhsavs="17937.6000" />
        <totkwhsavs date="2008-10-30" kwhsavs="264252.4800" />
        <totkwhsavs date="2008-10-31" kwhsavs="9727.6800" />
        <totkwhsavs date="2008-11-03" kwhsavs="51020.1600" />
        <totkwhsavs date="2008-11-20" kwhsavs="5414.4000" />
        <totkwhsavs date="2008-11-21" kwhsavs="14672.6400" />
        <totkwhsavs date="2008-11-25" kwhsavs="5414.4000" />
        <totkwhsavs date="2008-12-01" kwhsavs="2165.7600" />
        <totkwhsavs date="2008-12-03" kwhsavs="10558.0800" />
        <totkwhsavs date="2008-12-05" kwhsavs="292814.4000" />
        <totkwhsavs date="2008-12-08" kwhsavs="342307.2000" />
        <totkwhsavs date="2008-12-09" kwhsavs="2707.2000" />
        <totkwhsavs date="2008-12-11" kwhsavs="4005.1200" />
        <totkwhsavs date="2008-12-16" kwhsavs="108993.6000" />
        <totkwhsavs date="2008-12-17" kwhsavs="7841.2800" />
        <totkwhsavs date="2008-12-18" kwhsavs="206042.8800" />
        <totkwhsavs date="2008-12-19" kwhsavs="163659.8400" />
        <totkwhsavs date="2008-12-22" kwhsavs="97653.1200" />
        <totkwhsavs date="2008-12-23" kwhsavs="161386.5600" />
        <totkwhsavs date="2008-12-26" kwhsavs="525004.8000" />
        <totkwhsavs date="2008-12-27" kwhsavs="95824.3200" />
        <totkwhsavs date="2008-12-29" kwhsavs="280452.4800" />
        <totkwhsavs date="2008-12-30" kwhsavs="442554.2400" />
        <totkwhsavs date="2008-12-31" kwhsavs="4610.8800" />
      </program>
      <program programName="Series 2">
        <totkwhsavs date="2008-07-01" kwhsavs="5283.9000" />
        <totkwhsavs date="2008-07-23" kwhsavs="17469.5700" />
        <totkwhsavs date="2008-07-30" kwhsavs="22569.0800" />
        <totkwhsavs date="2008-07-31" kwhsavs="13742.0100" />
        <totkwhsavs date="2008-08-01" kwhsavs="36402.7500" />
        <totkwhsavs date="2008-08-02" kwhsavs="61254.7100" />
        <totkwhsavs date="2008-08-18" kwhsavs="9888.1200" />
        <totkwhsavs date="2008-08-19" kwhsavs="30139.8300" />
        <totkwhsavs date="2008-08-20" kwhsavs="52721.6500" />
        <totkwhsavs date="2008-08-21" kwhsavs="5217.2100" />
        <totkwhsavs date="2008-08-25" kwhsavs="163535.8300" />
        <totkwhsavs date="2008-09-03" kwhsavs="18812.8000" />
        <totkwhsavs date="2008-09-04" kwhsavs="87868.2000" />
        <totkwhsavs date="2008-09-05" kwhsavs="65277.9300" />
        <totkwhsavs date="2008-09-09" kwhsavs="40875.8200" />
        <totkwhsavs date="2008-09-11" kwhsavs="64145.5300" />
        <totkwhsavs date="2008-09-12" kwhsavs="2064.9600" />
        <totkwhsavs date="2008-09-16" kwhsavs="7529.4100" />
        <totkwhsavs date="2008-09-17" kwhsavs="3012.8600" />
        <totkwhsavs date="2008-09-19" kwhsavs="21610.4900" />
        <totkwhsavs date="2008-09-20" kwhsavs="6932.5400" />
        <totkwhsavs date="2008-09-22" kwhsavs="7721.2100" />
        <totkwhsavs date="2008-09-23" kwhsavs="40967.6000" />
        <totkwhsavs date="2008-09-24" kwhsavs="75629.6900" />
        <totkwhsavs date="2008-09-25" kwhsavs="3022.6500" />
        <totkwhsavs date="2008-09-26" kwhsavs="85524.6500" />
        <totkwhsavs date="2008-09-27" kwhsavs="54166.3200" />
        <totkwhsavs date="2008-10-01" kwhsavs="87857.8100" />
        <totkwhsavs date="2008-10-02" kwhsavs="44671.7400" />
        <totkwhsavs date="2008-10-03" kwhsavs="28834.2800" />
        <totkwhsavs date="2008-10-06" kwhsavs="91743.7100" />
        <totkwhsavs date="2008-10-07" kwhsavs="20846.7800" />
        <totkwhsavs date="2008-10-08" kwhsavs="72984.9000" />
        <totkwhsavs date="2008-10-09" kwhsavs="107800.3700" />
        <totkwhsavs date="2008-10-10" kwhsavs="35978.6200" />
        <totkwhsavs date="2008-10-13" kwhsavs="13388.2900" />
        <totkwhsavs date="2008-10-14" kwhsavs="117283.5600" />
        <totkwhsavs date="2008-10-15" kwhsavs="26121.6000" />
        <totkwhsavs date="2008-10-16" kwhsavs="4479.6800" />
        <totkwhsavs date="2008-10-20" kwhsavs="12263.6000" />
        <totkwhsavs date="2008-10-21" kwhsavs="10964.9100" />
        <totkwhsavs date="2008-10-22" kwhsavs="17431.6800" />
        <totkwhsavs date="2008-10-29" kwhsavs="11556.2800" />
        <totkwhsavs date="2008-10-30" kwhsavs="17684.6600" />
        <totkwhsavs date="2008-10-31" kwhsavs="15702.8400" />
        <totkwhsavs date="2008-11-04" kwhsavs="53668.5300" />
        <totkwhsavs date="2008-11-05" kwhsavs="52350.2000" />
        <totkwhsavs date="2008-11-06" kwhsavs="57828.7900" />
        <totkwhsavs date="2008-11-11" kwhsavs="31006.9100" />
        <totkwhsavs date="2008-11-13" kwhsavs="48291.9000" />
        <totkwhsavs date="2008-11-20" kwhsavs="78897.6500" />
        <totkwhsavs date="2008-11-24" kwhsavs="23127.2300" />
        <totkwhsavs date="2008-11-25" kwhsavs="78861.3600" />
        <totkwhsavs date="2008-11-26" kwhsavs="11158.7800" />
        <totkwhsavs date="2008-12-01" kwhsavs="25061.2300" />
        <totkwhsavs date="2008-12-03" kwhsavs="25387.5800" />
        <totkwhsavs date="2008-12-04" kwhsavs="39855.6600" />
        <totkwhsavs date="2008-12-05" kwhsavs="10968.9500" />
        <totkwhsavs date="2008-12-16" kwhsavs="17024.3800" />
        <totkwhsavs date="2008-12-19" kwhsavs="35257.8500" />
      </program>
      <program programName="Series 3">
        <totkwhsavs date="2008-09-29" kwhsavs="33088.1500" />
        <totkwhsavs date="2008-09-30" kwhsavs="22931.1500" />
        <totkwhsavs date="2008-10-01" kwhsavs="56942.0000" />
        <totkwhsavs date="2008-10-02" kwhsavs="26399.0000" />
        <totkwhsavs date="2008-10-03" kwhsavs="26060.4500" />
        <totkwhsavs date="2008-10-06" kwhsavs="25107.6000" />
        <totkwhsavs date="2008-10-07" kwhsavs="40643.3900" />
        <totkwhsavs date="2008-10-08" kwhsavs="79733.4300" />
        <totkwhsavs date="2008-10-09" kwhsavs="62522.1000" />
        <totkwhsavs date="2008-10-10" kwhsavs="39355.0000" />
        <totkwhsavs date="2008-10-13" kwhsavs="128959.1700" />
        <totkwhsavs date="2008-10-14" kwhsavs="70101.0600" />
        <totkwhsavs date="2008-10-15" kwhsavs="38892.3700" />
        <totkwhsavs date="2008-10-16" kwhsavs="64203.1500" />
        <totkwhsavs date="2008-10-17" kwhsavs="70063.9100" />
        <totkwhsavs date="2008-10-18" kwhsavs="23487.7900" />
        <totkwhsavs date="2008-10-20" kwhsavs="93303.6400" />
        <totkwhsavs date="2008-10-21" kwhsavs="132008.0000" />
        <totkwhsavs date="2008-10-22" kwhsavs="73830.8600" />
        <totkwhsavs date="2008-10-23" kwhsavs="21890.0000" />
        <totkwhsavs date="2008-10-24" kwhsavs="40209.0000" />
        <totkwhsavs date="2008-10-28" kwhsavs="35039.6600" />
        <totkwhsavs date="2008-10-29" kwhsavs="148992.5000" />
        <totkwhsavs date="2008-10-30" kwhsavs="62943.6000" />
        <totkwhsavs date="2008-10-31" kwhsavs="57227.5000" />
        <totkwhsavs date="2008-11-03" kwhsavs="6973.7500" />
        <totkwhsavs date="2008-11-04" kwhsavs="3172.0000" />
        <totkwhsavs date="2008-11-05" kwhsavs="107385.5100" />
        <totkwhsavs date="2008-11-06" kwhsavs="95859.0000" />
        <totkwhsavs date="2008-11-07" kwhsavs="23940.0000" />
        <totkwhsavs date="2008-11-08" kwhsavs="2256.0000" />
        <totkwhsavs date="2008-11-12" kwhsavs="54702.0000" />
        <totkwhsavs date="2008-11-13" kwhsavs="37358.1500" />
        <totkwhsavs date="2008-11-14" kwhsavs="23471.6000" />
        <totkwhsavs date="2008-11-17" kwhsavs="146144.9000" />
        <totkwhsavs date="2008-11-21" kwhsavs="63987.7800" />
        <totkwhsavs date="2008-11-24" kwhsavs="66608.7100" />
        <totkwhsavs date="2008-11-25" kwhsavs="51839.6200" />
        <totkwhsavs date="2008-11-26" kwhsavs="25777.0950" />
        <totkwhsavs date="2008-12-01" kwhsavs="37789.4200" />
        <totkwhsavs date="2008-12-02" kwhsavs="25056.3000" />
        <totkwhsavs date="2008-12-03" kwhsavs="36452.6500" />
        <totkwhsavs date="2008-12-04" kwhsavs="30799.7500" />
        <totkwhsavs date="2008-12-05" kwhsavs="21878.9100" />
        <totkwhsavs date="2008-12-06" kwhsavs="18583.0000" />
        <totkwhsavs date="2008-12-08" kwhsavs="25552.6400" />
        <totkwhsavs date="2008-12-09" kwhsavs="97217.9900" />
        <totkwhsavs date="2008-12-10" kwhsavs="84285.9600" />
        <totkwhsavs date="2008-12-11" kwhsavs="29488.8000" />
        <totkwhsavs date="2008-12-12" kwhsavs="13433.6300" />
      </program>
      <program programName="Series 4">
        <totkwhsavs date="2008-01-10" kwhsavs="192711.6750" />
        <totkwhsavs date="2008-01-16" kwhsavs="47435.5450" />
        <totkwhsavs date="2008-01-25" kwhsavs="42353.9250" />
        <totkwhsavs date="2008-01-29" kwhsavs="97847.8450" />
        <totkwhsavs date="2008-02-06" kwhsavs="106005.5750" />
        <totkwhsavs date="2008-02-07" kwhsavs="100189.7250" />
        <totkwhsavs date="2008-02-08" kwhsavs="67175.9400" />
        <totkwhsavs date="2008-02-18" kwhsavs="47212.8100" />
        <totkwhsavs date="2008-02-19" kwhsavs="47212.8100" />
        <totkwhsavs date="2008-02-27" kwhsavs="41060.1700" />
        <totkwhsavs date="2008-03-18" kwhsavs="160624.4700" />
        <totkwhsavs date="2008-03-20" kwhsavs="190567.2250" />
        <totkwhsavs date="2008-03-31" kwhsavs="113977.6800" />
        <totkwhsavs date="2008-04-09" kwhsavs="113977.6800" />
        <totkwhsavs date="2008-04-10" kwhsavs="122362.9500" />
        <totkwhsavs date="2008-04-15" kwhsavs="1154678.0460" />
        <totkwhsavs date="2008-04-28" kwhsavs="373095.0400" />
        <totkwhsavs date="2008-05-01" kwhsavs="179670.3000" />
        <totkwhsavs date="2008-05-02" kwhsavs="179670.3000" />
        <totkwhsavs date="2008-06-27" kwhsavs="987469.3110" />
        <totkwhsavs date="2008-06-30" kwhsavs="619132.6150" />
        <totkwhsavs date="2008-07-04" kwhsavs="99837.4600" />
        <totkwhsavs date="2008-07-11" kwhsavs="35544.5500" />
        <totkwhsavs date="2008-07-15" kwhsavs="142191.3850" />
        <totkwhsavs date="2008-07-16" kwhsavs="267963.6250" />
        <totkwhsavs date="2008-07-17" kwhsavs="179670.3000" />
        <totkwhsavs date="2008-07-18" kwhsavs="181073.0250" />
        <totkwhsavs date="2008-07-21" kwhsavs="100189.7250" />
        <totkwhsavs date="2008-07-23" kwhsavs="285445.3350" />
        <totkwhsavs date="2008-07-25" kwhsavs="85032.5900" />
        <totkwhsavs date="2008-07-31" kwhsavs="190181.5650" />
        <totkwhsavs date="2008-08-01" kwhsavs="66917.1450" />
        <totkwhsavs date="2008-08-02" kwhsavs="50481.8250" />
        <totkwhsavs date="2008-08-04" kwhsavs="101596.6100" />
        <totkwhsavs date="2008-08-14" kwhsavs="82165.2600" />
        <totkwhsavs date="2008-08-15" kwhsavs="41948.9950" />
        <totkwhsavs date="2008-08-19" kwhsavs="517683.2010" />
        <totkwhsavs date="2008-08-21" kwhsavs="59952.7930" />
        <totkwhsavs date="2008-08-22" kwhsavs="517683.2010" />
        <totkwhsavs date="2008-08-29" kwhsavs="115995.9250" />
        <totkwhsavs date="2008-09-22" kwhsavs="1363410.4460" />
        <totkwhsavs date="2008-09-23" kwhsavs="130221.7600" />
        <totkwhsavs date="2008-09-24" kwhsavs="82165.2600" />
        <totkwhsavs date="2008-09-25" kwhsavs="70834.1000" />
        <totkwhsavs date="2008-09-29" kwhsavs="313580.8270" />
        <totkwhsavs date="2008-09-30" kwhsavs="41948.9950" />
        <totkwhsavs date="2008-10-01" kwhsavs="120869.1520" />
        <totkwhsavs date="2008-10-08" kwhsavs="41575.7350" />
        <totkwhsavs date="2008-10-23" kwhsavs="27624.5000" />
        <totkwhsavs date="2008-11-05" kwhsavs="121396.2650" />
        <totkwhsavs date="2008-11-06" kwhsavs="120869.1520" />
        <totkwhsavs date="2008-11-07" kwhsavs="70834.1000" />
        <totkwhsavs date="2008-11-11" kwhsavs="1037228.5230" />
        <totkwhsavs date="2008-11-12" kwhsavs="584143.5000" />
        <totkwhsavs date="2008-11-14" kwhsavs="138229.3520" />
        <totkwhsavs date="2008-11-17" kwhsavs="382103.4810" />
        <totkwhsavs date="2008-11-20" kwhsavs="339721.4770" />
        <totkwhsavs date="2008-11-24" kwhsavs="211180.9280" />
      </program>
    </root>

  • Programitically creating column series to flex chart not showing the chart

    I want to create n number of series dynamically when i run my
    application.
    where n can be any value it depends on the data which i
    retrieve from database. below i pasted the example
    ( in this example i have taken n = 4 i.e., CountMax=4 if i
    change the CountMax=6 then it should generate 6series dynamically
    after calculating the values. ). just copy the below code and paste
    it in Flex builder and run the application.
    in this example i am facing problem, chart series are not
    showing. i dont know the reason why its not showing, if anyone got
    the solutions for the problem please let me know. my actual
    requirement is to retrieve data from Salesforce account and want to
    populate the arraylist then display the chart.
    <?xml version="1.0"?>
    <!-- Example showing using mx:LineSeries vs using AS to
    create chart series programmatically -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="drawChart()" layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.charts.series.ColumnSeries;
    import mx.charts.series.LineSeries;
    import mx.collections.ArrayCollection;
    [Bindable]
    public var categoryArray:ArrayCollection = new
    ArrayCollection();
    [Bindable]
    public var sArray:ArrayCollection = new ArrayCollection();
    public function drawChart():void
    var histMax:int = 25;
    var histMin:int = 5;
    var countMax:int = 6;
    var tmpArr:Array = new Array();
    categoryArray.removeAll();
    for(var n:int = 0; n < 10; n++)
    tmpArr[n] = histMin + Math.round((2 * n) / 20 * (histMax -
    histMin));
    categoryArray.addItem({data:tmpArr[n]});
    // Add a series to the chart with the x-values and y-values
    // from the arrays and set the series type to a column chart
    for(var chartSeries:int = 0; chartSeries < countMax;
    chartSeries++)
    var tmpseries:Array = new Array(10);
    for(var i:int = 1; i < 10; i++)
    tmpseries = 3 * Math.random();
    var cs:ColumnSeries = new ColumnSeries();
    columnchart1.series.join( = [cs];
    sArray.addItem({data:tmpseries});
    //columnchart1.dataProvider = sArray;
    cs = new ColumnSeries();
    cs.dataProvider= sArray;
    cs.displayName = 'Series';
    cs.yField = 'data';
    columnchart1.series[chartSeries] = cs;
    ]]>
    </mx:Script>
    <mx:Panel title="Dynamic Series Adding Sample"
    width="195%" height="90%" layout="absolute">
    <mx:ColumnChart id="columnchart1" height="338"
    width="396" showDataTips="true" type="stacked" x="10" y="0">
    <mx:horizontalAxis>
    <mx:CategoryAxis dataProvider="{categoryArray}"
    categoryField="data"/>
    </mx:horizontalAxis>
    <mx:verticalAxis>
    <mx:LinearAxis baseAtZero="true" maximum="3"
    autoAdjust="true"/>
    </mx:verticalAxis>
    </mx:ColumnChart>
    </mx:Panel>
    </mx:Application>

    <?xml version="1.0"?>
    <!-- Example showing using mx:ColumnSeries vs using AS to
    create chart series programmatically -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="drawChart()" layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.graphics.SolidColor;
    import mx.charts.HitData;
    import mx.controls.Alert;
    import mx.charts.series.ColumnSeries;
    import mx.charts.series.LineSeries;
    import mx.collections.ArrayCollection;
    [Bindable]
    public var categoryArray:ArrayCollection = new
    ArrayCollection();
    public function drawChart():void
    var histMax:int = 25;
    var histMin:int = 5;
    var countMax:int = 3;
    var tmpArr:Array = new Array();
    categoryArray.removeAll();
    for(var n:int = 0; n < 10; n++)
    tmpArr[n] = histMin + Math.round((2 * n) / 20 * (histMax -
    histMin));
    categoryArray.addItem({data:tmpArr[n]});
    var cs:ColumnSeries = new ColumnSeries();
    columnchart1.series = [cs];
    // Add a series to the chart with the x-values and y-values
    // from the arrays and set the series type to a column chart
    for(var chartSeries:int = 0; chartSeries < countMax;
    chartSeries++)
    var tmpseries:Array = new Array(10);
    for(var i:int = 0; i < 10; i++)
    tmpseries
    = 1 * Math.random();
    if(tmpseries > 0.5)
    tmpseries
    = 1;
    else
    tmpseries = 0;
    var testArrCol:ArrayCollection = new ArrayCollection();
    for(var j:int =0; j < 10; j++)
    var m:Number = tmpArr[j];
    var m1:Number = tmpseries[j];
    testArrCol.addItem({mData:m.toString(),nData:m1.toString()});
    cs = new ColumnSeries();
    cs.dataProvider = testArrCol;
    cs.displayName = 'Series' + chartSeries;
    cs.xField = 'mData';
    cs.yField = 'nData';
    columnchart1.series[chartSeries] = cs;
    public function myTipFunction(hitData:HitData):String
    return(ColumnSeries(hitData.element).displayName +" - "+
    hitData.item.mData + "\n" + "Value : "+ hitData.item.nData);
    ]]>
    </mx:Script>
    <mx:Panel title="Dynamic Series Adding Sample" width="98%"
    height="90%" layout="absolute">
    <mx:ColumnChart id="columnchart1" height="338"
    width="396" showDataTips="true" type="stacked" x="10" y="0"
    dataTipFunction="{myTipFunction}">
    <mx:horizontalAxis>
    <mx:CategoryAxis dataProvider="{categoryArray}"
    categoryField="data"/>
    </mx:horizontalAxis>
    <mx:verticalAxisRenderer>
    <mx:AxisRenderer visible="false"/>
    </mx:verticalAxisRenderer>
    </mx:ColumnChart>
    </mx:Panel>
    </mx:Application>

  • How to create a Power Pivot Chart with Dynamic X-Axis (date time) similar to that in Performance monitor (Start-- Run-- Perfmon)?

    Hi,
    I want to create a Power Pivot Chart and a Power View chart in Power BI where the x-axis should be the current system date time axis and it's functionality should be similar to that in Perfmon.exe tool (Start-->Run-->Perfmon)?

    Hi Manjunath,
    Do you mean you want to programmatically create such a dynamic chart which has a X axis of time? If you just want to do this manually, please take a look at this document which is talking about how to create charts with Power BI:
    Charts and other visualizations in Power View
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Dynamically creating charts

    i am trying to dynamically create a chart but it isn't
    working. can someone look at my code and tell me what i am doing
    wrong.
    private function addGraph(event:Event):void {
    var gr:ColumnChart = new ColumnChart();
    gr.id="graph2";
    gr.dataProvider="{feedRequest.lastResult.videos.video}";
    var series:Object = gr.series[0]; ////(i tried var
    series:Object = graph2.series[0]; but this returns error:undef
    property graph2)
    series.yField = "views";
    hbox1.addChild(gr);
    i tried modelling the code after the 3rd example at:
    http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDo cs_Parts&file=00001212.html
    here is the httpservice:
    <mx:HTTPService id="feedRequest" url="
    http://ws.jamesward.org/youtube.xml"
    useProxy="false"/>

    i also tried taking out the event:Event so the function
    reads...
    private function addGraph():void {...

  • Need help in creating a chart from 3 datasets

    Need help in creating a chart in SSRS from 3 datasets
    Can someone help me in creating a chart from 3 datasets, however datasource is same.

    Thank you Olaf...
    could anyone help me in using union all with the below
     WITH a AS (
    SELECT
    clientid,
    DATEPART(year, row_date) AS 'Year',
    DATEPART(month, row_date) AS 'Month',
        value ,
        CASE metricid WHEN 16 THEN 'FCR' ELSE 'Cases' END AS metric
    FROM XXXXXX AS V
    WHERE metricid IN (16, 11)
    AND row_date BETWEEN '2012-01-01' AND '2014-10-01'
    AND value IS NOT NULL)
    , b AS (
    SELECT     clientid ,
        Year ,
        Month ,
        value AS 'Cases',
        metric 
    FROM a
    WHERE metric = 'cases')
    , c AS (
    SELECT     clientid ,
        Year ,
        Month ,
        value AS 'FCR',
        metric  
    FROM a
    WHERE metric = 'FCR')
    , d AS (
    SELECT b.YEAR, b.MONTH, c.FCR, b.Cases 
    FROM b INNER JOIN c 
    ON c.clientid = b.clientid
    AND c.[YEAR] = b.[year] 
    AND c.[month] = b.[month]
    WHERE c.fcr <> 0 AND b.cases <> 0
    ,E AS (
    SELECT [Year], [Month], SUM(FCR) AS FCR, SUM(Cases) AS Cases
    FROM d
    GROUP BY [Year], [Month])
    select YEAR, MONTH, 
    CASE MONTH 
    WHEN 1 THEN 'Jan'
    WHEN 2 THEN 'Feb'
    WHEN 3 THEN 'Mar'
    WHEN 4 THEN 'Apr'
    WHEN 5 THEN 'May'
    WHEN 6 THEN 'Jun'
    WHEN 7 THEN 'Jul'
    WHEN 8 THEN 'Aug'
    WHEN 9 THEN 'Sep'
    WHEN 10 THEN 'Oct'
    WHEN 11 THEN 'Nov'
    WHEN 12 THEN 'Dec'
    END AS MonthName
    ,e.FCR AS FCRCases
    ,e.Cases AS TotalCases
    ,CASE 
    WHEN [month] IN (11, 12, 1) THEN 1
    WHEN [month] IN (2, 3, 4) THEN 2
    WHEN [month] IN (5, 6, 7) THEN 3
    WHEN [month] IN (8, 9, 10) THEN 4
    END AS 'Quarter'
    --,CONVERT(DECIMAL(18, 2),(e.FCR/e.Cases)*100) AS FCRRaw
    from e
    order by YEAR, MONTH
    **************2nd query*************
    WITH a AS (
    SELECT
    clientid,
    DATEPART(year, row_date) AS 'Year',
    DATEPART(month, row_date) AS 'Month',
        value, 
        CASE metricid WHEN 56 THEN 'numerator' ELSE 'denominator' END AS metric
    FROM XXXXXXX.[Values] AS V
    WHERE metricid IN (56, 10)
    --WHERE metricid IN (11,16)
    AND row_date BETWEEN '2013-10-01' AND '2014-02-01'
    AND value IS NOT NULL)
    , b AS (
    SELECT     clientid ,
        Year ,
        Month ,
        value AS 'numerator',
        metric
    FROM a
    WHERE metric = 'numerator')
    , c AS (
    SELECT     clientid ,
        Year ,
        Month ,
        value AS 'denominator',
        metric
    FROM a
    WHERE metric = 'denominator')
    , d AS (
    SELECT b.YEAR, b.MONTH, c.denominator, b.numerator 
    FROM b INNER JOIN c 
    ON c.clientid = b.clientid
    AND c.[YEAR] = b.[year] 
    AND c.[month] = b.[month]
    WHERE c.denominator <> 0 AND b.numerator <> 0
    , e AS (
    SELECT [Year], [Month], SUM(numerator) AS numerator, SUM(denominator) AS denominator
    FROM d
    GROUP BY [Year], [Month]
    SELECT *, 
    CASE 
    WHEN [month] IN (11, 12, 1) THEN 1
    WHEN [month] IN (2, 3, 4) THEN 2
    WHEN [month] IN (5, 6, 7) THEN 3
    WHEN [month] IN (8, 9, 10) THEN 4
    END AS 'Quarter'
    FROM e
    ORDER BY 1,2
    ******************3rd query**************
    WITH a AS (
    SELECT --L.[LocationGroupId],
    -- T.locationid,
    -- T.AccountId,
    TR.datestamp,
    /*Convert(NVARCHAR, DatePArt(year, TR.datestamp)) + '-' + Convert(NVARCHAR, DatePArt(month, TR.datestamp)) + '-01'*/ 
    TR.Period AS ValueDate,
    CASE WHEN TR.TargetResultState = 0 THEN 0 WHEN TR.TargetResultState = 1 THEN 1 WHEN TR.TargetResultState = 2 THEN 1 ELSE 0 END AS Met,
    CASE WHEN CONVERT(DATE, Convert(NVARCHAR, DatePArt(year, TR.datestamp)) + '-' + Convert(NVARCHAR, DatePArt(month, TR.datestamp)) + '-01') > T.Startdate AND CONVERT(DATE, Convert(NVARCHAR, DatePArt(year, TR.datestamp))
    + '-' + Convert(NVARCHAR, DatePArt(month, TR.datestamp)) + '-01') < T.Enddate THEN 1 ELSE 0 END AS ActiveTarget
    FROM XXXXXX AS TR
    INNER JOIN dbo.Target T ON TR.TargetID = T.ID
    --INNER JOIN dbo.Location L ON T.Locationid = L.Id
    WHERE --locationid <> - 1 AND 
    TR.Period IN ('201306', '201307', '201308', '201309', '201310', '201311', '201312', '201401'))
    select ValueDate, SUM(Met) AS Met, Count(ActiveTarget) AS ActiveTargets,
    right(ValueDate,2) as Month
    ,left(ValueDate,4) as Year
    ,CASE 
    WHEN right(ValueDate,2) IN (11, 12, 1) THEN 1
    WHEN right(ValueDate,2) IN (2, 3, 4) THEN 2
    WHEN right(ValueDate,2) IN (5, 6, 7) THEN 3
    WHEN right(ValueDate,2) IN (8, 9, 10) THEN 4
    END AS 'Quarter'
    from a
    group by ValueDate
    order by ValueDate

  • Need help in creating tabbed webpart in sharepoint + no of tabs in webpart should be dynamic.

    Need help in creating tabbed webpart in sharepoint and no of tabs in webpart should be dynamic.
    under each tab i should be able to add multiple webparts(each tab will have webpart zone)
    programatically i need to generate tabs and insert webpart zones under each tab.
    Let me  know how can i achieve this.
    i followed below article.
    http://msdn.microsoft.com/en-us/library/jj573263%28v=office.14%29.aspx
    but in this article the tabs and webparts are static and we need to close each webpart .
    Kindly let me know the approach.thanks in advance

    the Easy Tabs could be useful for your requirement
    http://usermanagedsolutions.com/SharePoint-User-Toolkit/Pages/Easy-Tabs-v5.aspx
    /blog
    twttr @esjord

  • Help Required: Updating Multiple dynamically created rows in database

    Hi All,
    In my jsp page I am retriving the values from the database and displaying in the jsp page, the columns are studentID and student name. Now for each studentID i am creating two textfields as date of birth and parent name.
    my code snippet is as follows
    while(rs.next())
    <tr>
    <td><%=studID%></td>
    <td><%=name%></td>
    <td><input type="text" name="DOB<%=studID%>"></td>
    <td><input type="text" name="PName<%=studID%>"></td>
    </tr>
    from the above code i am getting dynamically create textfield whose names are
    <input type="text" name="DOB10001">
    <input type="text" name="PName10001">
    and so on now how can i capture all these values and update the corresponding records in the database.
    Please help me in this
    Thanks in advance

    well in that case u can do this
    int i=0;
    while(rs.next())
    <tr>
    <td><%=studID%></td>
    <td><%=name%></td>
    <td><input type="text" name="DOB<%=i%>"><input type="hidden" name="h_DOB<%=i%>" value="<%=studID%>" ></</td>
    <td><input type="text" name="PName<%=i%>"></td>
    </tr>
    <%i++%>
    <input type="hidden" name="RecordCount" value="<%=i%>" >
    when u submit this for then in the other jsp u can read the data from query string
    int li_rec_count = Integer.parseInt(request.getParameter("RecordCount"));
    for(int i=0;i<li_rec_count;i++)
    String studID = request.getParameter("h_DOB"+i);
    String dob = request.getParameter("DOB"+i);
    String pName = request.getParameter("pName"+i);
    create your sql statment and update for each studID
    }

  • Help needed when dynamically creating new stage sprites

    Morning folks,
    I'm feeling very rusty when asking this question! It feels
    like I should
    know the answer but simply unable to comprehend where I'm
    going wrong at the
    moment!!
    I'm in the process of creating a Director piece that involves
    the user
    having to drag "shapes" onto a pre-defined grid [drag and
    drop style] --
    there are currently three different types of shape that can
    be dragged of
    which many of the shapes can be of the same type. So I need
    to display the
    three shape types on one side of the screen and allow the
    user to drag and
    drop as many as they wish to the girded area.
    I've written the drag and drop routine but now having
    difficulty in
    producing the dynamic creation of a new draggable shape; so
    far I've managed
    to create a new "shape" sprite from my cast library and
    placed it in the
    correct location. Then I create and add a new instance of my
    "Drag and Drop"
    behaviour onto the newly created sprite, but this is where it
    goes wrong --
    although I can drag the dynamically created sprite, once
    dropped Director
    complains of not knowing what its local properties are, for
    example I'm
    unable to reference the locH and locV of the newly created
    sprite!
    I'm really at a loss on this one and would appreciate any
    kind of guidance!
    Many thanks in advance, Mark ;-)

    Hi Saravanan,
    >>>><b>First column - Welcome message , below Date , time and place</b>
       It is possible to add date, time and location in the welcome area. Jus add a table to the <td> of the welcome area container. Like this.
    <% Date d= new Date(); %>
    <TD nowrap class="prtlHdrWelcome" ti="0" tabIndex="0" id="welcome_message"><%=StringUtils.escapeToHTML(GetWelcomeMsg(componentRequest, welcomeClauseStr))%><table width="100"><tr><td nowrap><%=d%></td><td>INDIA</td></tr></table></TD>
    Hope it helps.
    Regards,
    Saravanan
    P.S: Hope you remember the thread
    <a href="http://">https://www.sdn.sap.com/irj/sdn/thread?threadID=152135&messageID=1703666</a>

  • Dynamic series in flash chart & color specified for each series

    Example of data:
    Date     Series 1     Series 2     Series 3     Series 4     Series 5     Series 6     Series 7     Series 8
    A     12     22     23     22     22     10     10     10
    B     10     9     55     8     8     20     20     20
    C     55     2     5     88     5     15     15     15
    In excel, I can get a stacked horizontal bar chart with the numbers of different series stacked and it is easy to specify the color for each series (it works with Dephi aslo).
    I use a PL/SQL to generate the dynamic series for the chart. And in my application, I need to show some serires with the same color (group of series, each has a specified color). One of the solution I am trying is to input a fixed color sequence and loop it many times in the custom color theme and then insert dummy series into the SQLS. But this could be a disaster while the number of group goes up.
    Anyone has better idea on this? Or is this a limiation of apex?
    Thanks.

    As I tried, apex can support 300 series at most. Dynamic series here is not a good solution still.

  • Dynamic change color of series in line chart

    Hi
    I would like to be able to dynamically change the color of the individual series in a line chart, based on user preference. It works excellent having dynamic labels on the series using the &item. syntax and a before header computation.
    The same approach for the color does not seem to work. I get errors like undefined entity....
    Any ideas?
    Best regards Jesper

    Very surprisingly the following code (also generated by the macro recording) works ok.
    (I selected the serie inside the chart instead of selecting the serie in the legend)
        ActiveChart.FullSeriesCollection(1).Select
        With Selection.Format.Fill
            .Visible = msoTrue
            .ForeColor.ObjectThemeColor = msoThemeColorAccent3
            .ForeColor.TintAndShade = 0
            .ForeColor.Brightness = -0.25
            .Transparency = 0.3000000119
            .Solid
        End With
    If an MVP or Microsoft official come accross this, I suggest further testing as it is very likely a bug (with the first set of code generated by Excel)

  • Creating Dynamic Time Series in Hyperion Profitability and  Cost Management

    I am creating Dimensions in Dimension Library for Hyperion Profitability and Cost Management. Please let me know if we can set Dynamic Time Series for HPCM.
    I can see DTS Manager option for Period Dimension in Hyperion Planning but this option is not available for Period Dimension in HPCM Application.
    Is there any other way to drill down upto weeks level or day level data in Time Series.

    I am also facing the same issue. Does we have any option to create Dynamic time series in HPCM. Please let me know.

  • Help with creating Box2D bodies dynamically, according to shape.

    Hello everyone,
    I am having some issues on how to dynamically create Box2D bodies dynamically, according to the shape.
    So far this is how I've layed out my project in attempt to do this...
    Main class:
    package
    //imports
              public class Architecture extends Sprite
                        public var world:b2World;
                        public var stepTimer:Timer;
                        public var mToPx:Number = 20;
                        public var pxToM:Number = 1 / mToPx;
                        protected var shapeObjectDirector:ShapeObjectDirector = new ShapeObjectDirector();
                        public function Architecture()
      //gravity
                                  var gravity:b2Vec2 = new b2Vec2(0, 10);
                                  world = new b2World(gravity, true);
      //debug draw
                                  var debugDraw:b2DebugDraw = new b2DebugDraw();
                                  var debugSprite:Sprite = new Sprite();
                                  addChild(debugSprite);
                                  debugDraw.SetSprite(debugSprite);
                                  debugDraw.SetDrawScale(mToPx);
                                  debugDraw.SetFlags(b2DebugDraw.e_shapeBit);
                                  debugDraw.SetAlpha(0.5);
                                  world.SetDebugDraw(debugDraw);
      //declarations
                                  var wheelBuilder:WheelBuilder = new WheelBuilder(world, pxToM);
                                  createShape(wheelBuilder, 0, 0, 0, 0);
      //timer
                                  stepTimer = new Timer(0.025 * 1000);
                                  stepTimer.addEventListener(TimerEvent.TIMER, onTick);
                                  stepTimer.start();
                        private function createShape(shapeObjectBuilder:ShapeObjectBuilder, pxStartX:Number, pxStartY:Number, mVelocityX:Number, mVelocityY:Number):void
                                  shapeObjectDirector.setShapeObjectBuilder(shapeObjectBuilder);
                                  var body:b2Body = shapeObjectDirector.createShapeObject(pxStartX * pxToM, pxStartY * pxToM, mVelocityX, mVelocityY);
                                  var sprite:B2Sprite = body.GetUserData() as B2Sprite;
                                  sprite.x = pxStartX;
                                  sprite.y = pxStartY;
                                  this.addChild(sprite);
                        public function onTick(event:TimerEvent):void
                                  world.Step(0.025, 10, 10);
                                  world.DrawDebugData();
    ShapeObjectBuilder class:
    package
    //imports
              public class ShapeObjectBuilder
                        public var body:b2Body;
                        protected var circle:b2CircleShape;
                        protected var polygon:b2PolygonShape;
                        protected var world:b2World, pxToM:Number;
                        protected var fixtureDef:b2FixtureDef;
                        protected var bodyDef:b2BodyDef;
                        protected var fixture:b2Fixture;
                        protected var startingVelocity:b2Vec2;
                        protected var sprite:B2Sprite;
                        protected var restitution:Number, friction:Number, density:Number;
                        protected var mStartX:Number, mStartY:Number;
                        protected var mVelocityX:Number, mVelocityY:Number;
                        protected var Image:Class;
                        public function ShapeObjectBuilder(world:b2World, pxToM:Number)
                                  this.world = world;
                                  this.pxToM = pxToM;
                        public function createCircleShape():void
                                  circle = new b2CircleShape();
                                  createFixtureDef(circle);
                        public function createPolygonShape():void
                                  polygon = new b2PolygonShape();
                                  createFixtureDef(polygon);
                        public function createFixtureDef(shape:b2Shape):void
                                  fixtureDef = new b2FixtureDef();
                                  fixtureDef.shape = shape;
                                  fixtureDef.restitution = restitution;
                                  fixtureDef.friction = friction;
                                  fixtureDef.density = density;
                        public function createBodyDef(mStartX:Number, mStartY:Number):void
                                  bodyDef = new b2BodyDef();
                                  bodyDef.type = b2Body.b2_dynamicBody;
                                  bodyDef.position.Set(mStartX, mStartY);
                        public function createBody():void
                                  body = world.CreateBody(bodyDef);
                        public function createFixture():void
                                  fixture = body.CreateFixture(fixtureDef);
                        public function setStartingVelocity(mVelocityX:Number, mVelocityY:Number):void
                                  startingVelocity = new b2Vec2(mVelocityX, mVelocityY);
                                  body.SetLinearVelocity(startingVelocity);
                        public function setImage():void
                                  sprite = new B2Sprite();
                                  var bitmap:Bitmap = new Image();
                                  sprite.addChild(bitmap);
                                  bitmap.x -= bitmap.width / 2;
                                  bitmap.y -= bitmap.height / 2;
                        public function linkImageAndBody():void
                                  body.SetUserData(sprite);
                                  sprite.body = body;
    ShapeObjectDirector class:
    package builders
    //imports
              public class ShapeObjectDirector
                        protected var shapeObjectBuilder:ShapeObjectBuilder;
                        public function ShapeObjectDirector()
      //constructor code
                        public function setShapeObjectBuilder(builder:ShapeObjectBuilder):void
                                  this.shapeObjectBuilder = builder;
                        public function createCircleObject():void
                                  shapeObjectBuilder.createCircleShape();
                        public function createPolygonObject():void
                                  shapeObjectBuilder.createPolygonShape();
                        public function createShapeObject(mStartX:Number, mStartY:Number, mVelocityX:Number, mVelocityY:Number):b2Body
                                  shapeObjectBuilder.createBodyDef(mStartX, mStartY);
                                  shapeObjectBuilder.createBody();
                                  shapeObjectBuilder.createFixture();
                                  shapeObjectBuilder.setStartingVelocity(mVelocityX, mVelocityY);
                                  shapeObjectBuilder.setImage();
                                  shapeObjectBuilder.linkImageAndBody();
                                  return shapeObjectBuilder.body;
    WheelBuilder class:
    package builders
      //imports
              public class WheelBuilder extends ShapeObjectBuilder
                        [Embed(source='../../lib/Basketball.png')]
                        public var Basketball:Class;
                        public function WheelBuilder(world:b2World, pxToM:Number)
                                  super(world, pxToM);
                                  restitution = 1.0;
                                  friction = 0.0;
                                  density = 5.0;
                                  Image = Basketball;
                                  circle.SetRadius(15 * 0.5 * pxToM);
    The above code did have some errors, but even if it worked I wouldn't have been happy. It was just my attempt at what I'm trying to achieve.
    What I want to is be able to call a function in my "Main" class to create a shape (Circle body or Polygon body), like so... createShape(wheelBuilder, 0, 0, 0, 0);
    I would like to make the class ShapeObjectDirector and ShapeObjectBuilder to be able to handle b2CircleShape() and b2PolygonShape(), but my problem is creating constants to handle both datatypes all in the one class.
    Basically, I need help with building a class to create shapes on the fly, with minimal code in the Main class. What do you guys suggest? I would be grateful for one of you's who have enough experience with this kind of thing to write me a post on how I can tackle this problem, all responses appreciated.
    Thankyou,
    Brendon.

    UIImageView initWithImage takes a UIImage* as a parameter, not NSString*. So load your image into a UIImage first
    UIImage *ballImage = [UIImage imageNamed:@"Ball.png"];
    UIImageView *tempStart = [[UIImageView alloc] initWithImage:ballImage];

  • Is there any Adobe product that can help me create crochet charts/diagrams?

    Is there any Adobe product that can help me create crochet charts/diagrams?

    I am not all that familar with Crochet, other than what my sisters and mother use to do 20+ years ago.
    What you could do is turn on the background grid and snap to grid. Find a grid size that will work for you (may be easier if you place an image for reference) Then with the pen tool you can create lines that follow the grid (assuming you want to print the grid)
    With the image placed you could add text for what color or change the lines color and print it out
    Anyway just an idea, it kind of hard to think with out seeing one. But then again if you have book of patterns you could use that as the reference. Just keep in mind that whats in that book is for your own use only, it can not be shared or sold to the public. As the book is protected by copyright laws. Any original work you do that is not in that book, is up to you on what you want to do with it.

Maybe you are looking for

  • Can I extend a MBP 15" to mac display and  another DVI monitor

    Hi,    I have a MBP 15" and I currently use mac display as my external monitor for my MBP via Thunderbolt. Can I also extend it to another monitor with DVI ? Is there any converters that can do that for me. Thanks

  • Vmware vsphere health check report v5.1.0

    Hi, I'm currently using the vmware vsphere health check report v5.1.0 script. I switched from another perl script to this and the report provide much more information. There is one thing that don't seem to work properly though.. I currently have a fa

  • Scrubber won't stop at end of timeline?

    Hi All: Just ran into a quirkly issue and wonder if anyone has a work around? I'm finding the scrubber on my timeline will not stop at the last clip, it keeps moving on past the end until I click it to stop. I used to be able to solve this by adding

  • Excel 2010 error when opening excel file

    Getting error "excel can not open the file xlsx because the file format or extension is not valid"

  • My program won't run properly

    Here's my JFrame apps, it's creating an array of 10 inner Car object and then proceeds to define the first two objects. Then through the buttons, Display Next, you're supposed to display the values in the object, starting with the first. I got the Cl