Displaying data in chart for each iteration of FOR loop

Hi Flex experts,
I'm coding an Actionscript routine that has a series of
complex calculations within a for loop. I would like to display
some of the calculation results in a Flex chart at the end of each
iteration of the loop. Thus far, I can only get the chart to
display the results from the last iteration, but not any of the
preceding iterations.
Any tips or pointers would be greatly appreciated.
Thanks,
Dean

Please have look at callLater method. You can call your
chart-updating method thru callLater and that might help.
Otherwise, can you share some of your code in the loop?
ATTA

Similar Messages

  • Problems with displaying data in Chart

    Hi, everyone
    I am stuck with displaying data in Chart. I set the minimum
    and maximum for LinearAxis of a LineChart, so the chart only
    display the data within this range. But sometimes I still need to
    keep the trend of all data even the data is out of range.
    eg, the range of verticalAxis is 0 -100 and I got data 70,
    120, 90. Neither I want to set the data 120 to 100 in order to keep
    the data point nor make the data 70 connected directly to data 90.
    All I want is to keep the shape, from 70 to 120, from 120 to 90,
    but 120 doesn't display in the chart.
    My another question is when I try to select an area of a
    chart to zoom in, how can I the get the exact area that I select to
    zoom,
    for example: I want to use exactly the result of the
    following line:
    ((firstMouseX - this.mouseX)/ this.dataRegion.width) *
    chart.dataProvider.length
    that is I don't want to use methods ceil or floor to get the
    approximate area.
    Excuse me, I got one question more. The weird things is my
    chart won't resize itself when I resize the VDividedBox or other
    containers. I set the width equals 100% wherever it needs to be.
    Just like the Flex sample - dashboard. If I open a small window at
    the very begining and then maximize the window, the chart still
    keep the small part of its container. I don't understand why.
    Sorry for too many questions.
    Hope someone can help me.
    Thanks in advance.

    Can I use the Interpolate to solve the first problem?
    But I have no idea about interpolate at all.
    Please help!

  • Display data into Chart Js

    1
    I Have Problem in display data into Chart Or chartJs ,
    In my Controller I Return Json and
    use it in javascript like this but i have
    error that tell me 't' is undefined
    $(document).ready(function () {
    $.getJSON("/Report/GetTransactions/", function (data) {
    debugger;
    var ctx = document.getElementById("myChart").getContext("2d");
    var myBarChart = new Chart(ctx).Bar(data);
    debugger;
    data = {
    labels: ["January", "February", "March", "April", "May", "June", "July"],
    datasets: [
    label: "My First dataset",
    fillColor: "rgba(220,220,220,0.5)",
    strokeColor: "rgba(220,220,220,0.8)",
    highlightFill: "rgba(220,220,220,0.75)",
    highlightStroke: "rgba(220,220,220,1)",
    data: [data]
    label: "My Second dataset",
    fillColor: "rgba(151,187,205,0.5)",
    strokeColor: "rgba(151,187,205,0.8)",
    highlightFill: "rgba(151,187,205,0.75)",
    highlightStroke: "rgba(151,187,205,1)",
    data: [data]
    and my controller is this
    return Json(_reportRepository.GetTransactions(), JsonRequestBehavior.AllowGet);

    Hi Mario Castro,
                              In selection Screen  initially u have to enter the input value after provides some user command only next screen will be trigger.
    In the next screen PBO event you cant assign selection screen Variable into next screen fields.
    Eg.
    Selection Screen Variable
              s_belnr
               s_bukrs
               s_gjahr
    Next Screen
               t_belnr
               t_bukrs
               t_gjahr
    In PBO  you can code
              t_belnr  = s_belnr
              t_bukrs = s_bukrs
             s_gjahr  =   s_gjahr
    Revert back if any difficulties to do.
    Regards,
           Thangam.P

  • Need new result file for each iteration of a loop

    I am using TestStand 2010 SP1.  I have a main sequence that essentially does the following:
    Initialize the test equipment and set up the test environment [Sequence Call]
    Start Loop
    Run Tests [Sequence Call]
    End Loop
    Because testing can continue for hours, the resultant report file is enormous and difficult to evaluate. I need to create a new result file for each loop iteration.  I know that starting a new execution of “Run Tests” will create a result file for each iteration of the loop, but the new execution will not have access to the handles to the test equipment that were made during initialization.  The testing is time critical, therefore initializing the test equipment and setting up the test environment must occur outside of the loop. 
    How can I programmatically create a new result file at the beginning of the loop and close the result file at the end of the loop?  I am open to any other suggestions.  Thank you in advance for your help!

    Hi,
    You could modify your process model by making a copy of Test UUTs entry point. Then make the loop that usually tests multiple UUTs into your loop. Take the loop and init out of your sequence. You can init in PreUUTLoop or the other pre loop sequence, and maybe store your references in runstate.root.Locals and pass them to MainSequence. Then you can use Report Options to set it for separate report files.
    cc

  • How to output data outtside a for loop every 10 iterations​?

    Hi friends,
    does any body help me to sort out this problem?
    please check the attchement for my vi.
    all i want is output data from inside for loop to outside for loop every 10 iterations. please do not use local variable.
    Many thanks
    dan
    Attachments:
    output.vi ‏16 KB

    Hi Dan,
    I am not sure what you want to do every 10 iterations with the value outside, but If you want to update your graph every 10 iterations use the following way:
    If you want to handle the specific value every x iterations outside the loop you could either use queues or notifieres.
    BR,
    ThSa
    Message Edited by ThSa on 08-23-2006 09:05 PM
    http://www.newgistics.com
    Attachments:
    1.png ‏6 KB

  • Indexing data on a for loop to overlay data on a xy graph

    I am using express VI's to measure both voltage and current data in a For Loop. I want to plot a current vs voltage graph but have each iteration of the loop overlay the others as if it were its own independent data set. I have been unable to bundle the data and convert it into a xy graph because of the number of elements, 3 for the bundle and 2 for the graph. I need a method to index the dynamic data wires so that I can overlay them.

    Hello,
    After reading the thread, it sounds like you're looking for a chart-like graph - I have attached an example with illustrates this.  Keep in mind that "graphs" in LabVIEW generally plot arrays of data (in the case of an XY graph, you pass a cluster which contains an X and Y array).  The example behaves like a chart by building an array one data point at a time (in this case both an X and Y array of course) on each iteration of a loop, and displaying the data at each loop iteration - this gives the look and feel of a chart which accumulates data.  It is attached in version 7.1 - hopefully you have that version or later to open it.  I have also attached a program which shows how to plot multiple data sets on an XY graph, in all 3 current formats accepted by the XY graph - it's attached in version 8.0 because the ability to plot complex data to an XY graph was added to version 8.0, and it illustrates this as well.
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear
    Attachments:
    XY Chart-like Example.vi ‏24 KB
    XYGraphWithArbitrarilyManyPlots.vi ‏32 KB

  • How to save a chart after each iteration in a for loop?

    Hello,
    I have written code which initializes a spectrometer. Once initialized, if the "Capture" button is pushed, the spectrometer takes a new spectrum three times (see for loop) every second. This spectrum is displayed as a chart in my front panel. My code runs fine...it will update the spectrum every second.
    However, I want to be able to save each of these three iterations as separate graphs. Basically, I want to click "Capture" and have my code save three charts to a specified folder. How do I go about doing this?
    I've attached my VI.
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Spectrometer Iteration.vi ‏444 KB

    Use Build Array to make a 2D Array of your X and Y data and use Write To Spreadsheet File to save the data.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Issue with displaying QM control chart for specific date range

    Dear All
    In our chemical mfg organisation, we just implemented SAP QM solution and things are working fine. I have implemented control  chart functionalities as below:
    SPC Criteria in Inspection Plan: Task List Charateristics / Material (0020)
    Sampling Procedure: Fixed Sample / SPC Inspection (without inspection point)
    We use process orders to get the inspection lots for products (material) and record results for the MICs and UD the inspection lots.
    Currently all our Control Chart have status 1 (created) and we have not moved any of those charts to status 3 and 5 yet.
    Using QGC1 when user trying to run control chart for any particular material in the plant and for a specific date range, report showing all the charts for that material with different MICs as expected. Though the result is NOT restricted to the selection dates either against "Lot Created On" or " Insp. Start Date" ( may be due to SPC criteria????) , its always showing all the result for any particular MIC for that material starting from go live till today.
    How to restrict the dispaly of result on the chart for any particular MIC against the Material / Plant within a specific date range ?
    Looking forward for your response.
    Best Regards
    SK

    Hi,
    1. Even though when i give the Created on, and to date the system is displaying the report which is prior to the created on date.
    2. Similarly the report data is different when the field is maximum no of Hits is given. for example when i giving this field as 10, 20, 30, etc the report is showing only 10 line items. if i enter 50, 60 etc it is showing the list for half i given.
    Note that system is having more than 1000 line items to display..
    Regards,
    R. Loganathan

  • Order of display in Org chart for ESS

    Hello,
    Is there any way to change the order of display of org chart based on per.No.
    Thanks, Abdul

    Hi Abdul,
    As name suggest ORG CHART it’s the image of your organization and its maintains certain hierarchy in SAP Standard … for e.g. You will get to see Orgunit  Then SubOrgunit  Head Position/Positions (Multipal)  Person Holding those positions.
    If you break this Hierarchy it will be difficult to trace the Employee and Duplication of records will take place …. There are Reports which displays Employee to Position and Orgunit … and the diplay of such report will be in Table and Colum Format .. it wount be in a Tree Format... you may go for Custom Development.
    But do Check these report they all are Report based on Object type.
    RHXSTR01  Organizational Structure with Positions
    RHXSTR02  Organizational Structure with Persons
    RHXEXI00  Existing Organizational Units
    ~Bhawanidutt.

  • To display data in alv for perticular way

    in my itab data is like below mentioned way
    1     1111               0.00     3404     EUR     53.86     D
    2     1111               0.00     1962     USD     1866.58     D
    3     1111               0.00     1231     USD     14387.51     D
    4     1111               0.00     1231     CAD     18251.13     D
    5     1111     1200     CAD     16660.25               0.00     R
    6     1111     1200     USD     43908.08               0.00     R
    7     1111     1231     CAD     895636.49               0.00     R
    8     1111     1231     USD     15470.37               0.00     R
    9     1111     1390     USD     11183.27               0.00     R
    10     1111     1552     CAD     33149.77               0.00     R
    i need to display data in ALV like
    company     1111                                   
         reciepts                         payments          
         1200     CAD     16660.25          3404     EUR     53.86     D
         1200     USD     43908.08          1962     USD     1866.58     D
         1231     CAD     895636.49          1231     USD     14387.51     D
         1231     USD     15470.37          1231     CAD     18251.13     D
         1390     USD     11183.27                         
         1552     CAD     33149.77          
    plz guid me to do this
    thanks ,
    vamsee
    Moderator message: you want the community to figure out the logic and provide the solution -> please try solving this yourself first, search for available information, provide more details about what you are trying to do when posting again.
    Edited by: Thomas Zloch on Nov 29, 2010 3:37 PM

    Hi expert,
    itab1 data.
    1 1111 0.00 3404 EUR 53.86 D
    types:begin of ty_data,
    fld1 type string,
    fld2 type string,
    fld3 type string,
    fld4 type string,
    fld5 type string,
    fld6 type string,
    end of ty_data.
    data:itab type standard table of ty_data,
    wa type ty_data.
    wa-fld1 = '1'.
    wa-fld2 = '111'.
    like so on -
    append wa to itab.
    please create the another internal table for below data.After the we can assign itab1 data to itab2 respective fields.
    types:begin of ty_data1,
    fld1 type string,
    fld2 type string,
    fld3 type string,
    fld4 type string,
    so on
    data:itab2 type standard table of ty_data1,
    wa2 type ty_data.
    loop at itab into wa.
    wa2-fld1 = wa-fld3.
    wa2-fld2 = wa-fld4.
    append wa2 to itab2.
    then we create the fieldcatlog for itab2 then only is work.In which u want to display on alv same way we can create.the internaltable(itab2).
    regards,
    muralii

  • Display value in MATLAB For loop on LabView

    Hi guys,
    I have a MATLAB script in my VI. The MATLAB script runs a For Loop. For each iteration of the For Loop, a variable say, count is incremented by 1.
    From what I am experiencing, the MATLAB script only outputs the final value of count when the script is done running.
    Is it possible to capture the value of count as each iteration is performed?
    PS : Using a LabView For loop is not possible for my case. Running the MATLAB code is mandatory.
    Thank you in advance!

    When the Matlab script gets called, it's actually passing control over to the Matlab ActiveX server. Thus, LabVIEW has to wait until that's done before it can proceed. What you're asking for is interprocess communication. That doesn't come provided "out of the box". You have to create it yourself. Some ideas were suggested here: http://forums.ni.com/t5/LabVIEW/Labview-Matlab-Exchange-Data/td-p/1408054

  • I'm having problems manipulating array data within a for loop, and extracting the required sub-arrays generated.

    Hi,
    I'm using labVIEW V5.1
    I'm trying to generate 10 1D arrays, the first array is initialized to all zeroes, then I have set up a for loop which shifts the first element by 1, then a random number is placed into the first element position. I am using a shift register to feed back in the newly generated array into the start of the loop.
    By the end of the each loop I want to be able to use the array generated in an algorithm outside the loop. However I only want the Nx1 array that has just been generated.
    Unfortunately, I cannot figure out how to resize, reshape or index the output array to do this.
    I would like the loop to
    give me out a 1D array after each iteration.
    Any help would be greatly appreciated.

    I hope I've understood your problem.
    First your vi was lacking of the sub-vi working as shift register, I've replaced it with the rotate function.
    The indexing of your arrays create a 2D array whose rows are your 1D array.To pick only one of them you have to use the index array function and select which one you want.
    To use your temporary data in another part of your application you should use a local variable of array2.
    I did it in a separated while loop That I syncronized with the for loop using occurrence, in this way the while loop runs each time a new value is inserted in array2 (each loop of the for loop structure).
    If you don't need this syncronization just get rid of occurrence functions.
    I place a delay in the for loop to show what happens when running.
    Hope it was helpful.
    Alberto Locatelli
    Attachments:
    array_test_v3.vi ‏35 KB

  • How create a variable that changes (by 0.05) on each iteration in a loop?

    We are trying to control  New Era Syringe pumps using Labview. We want that those pumps could dispense different volumes on wells. For example 0.05ml in well one (using actuators we can move the wells),  0.1ml in well 2, 0.15ml in well 3 and so on. We think that we may need a "For loop" in which the number of iteration is the number of wells, but we do not know how to create a variable, inside the loop that can increase .05 on each iteration, and then we can use that variable as a "volume input" in our program.

    Hi tbob,
    multiple add operations with floats may induce more errors than a multiply/divide due to floating point representations (especially on numbers that can't be represented exactly, like 0.05)... The next step in this routine might be a comparison of setpoint and measurement value
    Message Edited by GerdW on 05-10-2010 08:04 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Write a query to display HI using stars(for loop using)

    Hi all
    can u tell me please how to write this query
    HI
    write a query using for loop display the stars(*) in the place of H and I
    thanks regards
    Edited by: user9195968 on Apr 20, 2010 11:18 PM
    Edited by: user9195968 on Apr 20, 2010 11:26 PM

    user9195968 wrote:
    Hi all
    can u tell me please how to write this query
    HI
    write a query using for loop display the stars(*) in the place of H and I
    thanks regardsHere's a starter for you...
    SQL> ed
    Wrote file afiedt.buf
      1  with a as (select 'A' as ch, 2 as line1, 5 as line2, 7 as line3, 5 as line4, 5 as line5 from dual union all
      2             select 'B', 4, 5, 5, 5, 5 from dual union all
      3             select 'C', 3, 4, 4, 4, 3 from dual union all
      4             select 'D', 6, 5, 5, 5, 6 from dual union all
      5             select 'E', 7, 4, 6, 4, 7 from dual union all
      6             select 'F', 7, 4, 6, 4, 4 from dual union all
      7             select 'G', 3, 4, 5, 5, 2 from dual union all
      8             select 'H', 5, 5, 7, 5, 5 from dual union all
      9             select 'I', 7, 2, 2, 2, 7 from dual union all
    10             select 'J', 7, 1, 1, 1, 6 from dual union all
    11             select 'K', 5, 6, 4, 6, 5 from dual union all
    12             select 'L', 4, 4, 4, 4, 7 from dual union all
    13             select 'M', 5, 7, 5, 5, 5 from dual union all
    14             select 'N', 5, 5, 7, 5, 5 from dual union all
    15             select 'O', 2, 5, 5, 5, 2 from dual union all
    16             select 'P', 6, 5, 6, 4, 4 from dual)
    17  --
    18      ,w as (select 'HI' as word from dual)
    19  --
    20      ,chrs as (select rownum as chnum, substr(word,rownum,1) as ch
    21                from w
    22                connect by rownum <= length(word))
    23  --
    24  select decode(rn,1,decode(bitand(line1,4),4,'*',' ')||decode(bitand(line1,2),2,'*',' ')||decode(bitand(line1,1),1,'*',' '))||
    25         decode(rn,2,decode(bitand(line2,4),4,'*',' ')||decode(bitand(line2,2),2,'*',' ')||decode(bitand(line2,1),1,'*',' '))||
    26         decode(rn,3,decode(bitand(line3,4),4,'*',' ')||decode(bitand(line3,2),2,'*',' ')||decode(bitand(line3,1),1,'*',' '))||
    27         decode(rn,4,decode(bitand(line4,4),4,'*',' ')||decode(bitand(line4,2),2,'*',' ')||decode(bitand(line4,1),1,'*',' '))||
    28         decode(rn,5,decode(bitand(line5,4),4,'*',' ')||decode(bitand(line5,2),2,'*',' ')||decode(bitand(line5,1),1,'*',' '))
    29  from chrs join a on (a.ch = chrs.ch)
    30       cross join (select rownum as rn from dual connect by rownum <= 5) x
    31* order by chnum, rn
    SQL> /
    DECODE(RN,1,DEC
    10 rows selected.
    SQL>To display characters as stars (as per the unix banner command) you need some sort of bitmap representation of your character set. As I've done, you can define your own, or you could probably get at the internal fonts somehow (I used to do this sort of thing in machine code back on the BBC Master, but not sure how you'd access the font/character set information from within Oracle)
    If you actually want the H and the I displaying next to each other then that's a little more work, but you can have a go at that yourself.

  • Display dates with zeros for month, day, year.

    I have a date coming from a database as an int (20021215 means 12/15/2002). If the database gives me a "0", meaning no date value is assigned, then it should be displayed as "00/00/0000". The following code snippet works for the non-zero int database values ...
    public static String formatDisplayDate(int date) {
        String dateAsString = null;
        if (date == 0) {
            dateAsString = "00000000";
        else {
            dateAsString = Integer.toString(date);
        String strYear = dateAsString.substring(0,4);
        String strMonth = dateAsString.substring(4,6);
        String strDay = dateAsString.substring(6);
        int year = Integer.parseInt(strYear);
        int month = (Integer.parseInt(strMonth)) - 1;
        int day = Integer.parseInt(strDay);
        DateFormat myFormat = DateFormat.getDateInstance(DateFormat.SHORT);
        Calendar cal = myFormat.getCalendar();
        cal.set(year, month, day);
        Date myDate = cal.getTime();
        String formattedDate = myFormat.format(myDate);
        return formattedDate;
    }Although I didn't really expect the zero values case to work, I am not sure how to implement it. How would I go about building a string using all zeros and still have it automatically display in the correct locale format?
    Any help is appreciated.

    Thank you for your response. I agree a blank field would be better, but I think the "zeros" format is there to give the user an idea of expected date entry formatting, not that they'll necessarily follow it. I have made a few changes per your suggestions (shown below for the record, minus the exception handling), and it works perfectly.
    public static String formatExternalDate8(int date) {
      String dateAsString = null;
      if (date == 0) {
        dateAsString = "00010101";
      else {
        dateAsString = Integer.toString(date);
      int year = Integer.parseInt(dateAsString.substring(0,4));
      int month = (Integer.parseInt(dateAsString.substring(4,6))) - 1;
      int day = Integer.parseInt(dateAsString.substring(6));
      DateFormat myFormat = DateFormat.getDateInstance(DateFormat.SHORT);
      Calendar cal = myFormat.getCalendar();
      cal.set(year, month, day);
      Date myDate = cal.getTime();
      String formattedDate = myFormat.format(myDate);
      if (date == 0) {
        formattedDate = formattedDate.replace('1', '0');
      return formattedDate;
    }Thanks again for your assistance.

Maybe you are looking for

  • Ipod nano does not turn on.

    My ipod nano appears to be dead. Nothing is on the screen. When I press Menu and select and hold down, nothing happens. When I charge it, nothing happens. Any ideas?

  • PDF doesn't open in Firefox

    This seems to be a common problem. Firefox fails to open PDF files. It just shows a blank white screen. The common solution is to shut off the Adobe Reader add-on. Well, it didn't work for me. PDF is still not loading.

  • Some opengl screensavers not working (maybe rss-glx)

    I am having a problem with some of my opengl screensavers.  The screensaver preview appears black, and when I try to test them they do not appear at all.  I think they are the rss-glx screensavers, but a couple of what I think are rss-glx screensaver

  • The blue circle bar is stuck and I can't download apps in App Store

    So yeah I can't download apps, it all stared past few days, I downloaded tons of apps and lastly I downloaded Asphalt 8 and since then when I download app like mortal combat X it won't download it, the blue circle keeps going back and back when you l

  • Can't turn off "Confirm Delete" option in messages

    I've tried 100 times through "messages>options>general options>Confirm Delete> NO>save" but it won't stay on NO. The next time I go into message options, it's turned itself back on to 'YES' I have done a battery pull, but no matter what I try, the "C