How to dynamically generate data to be consumed by a LineGraph?

Hello

I am trying to build a LineGraph with the data I have on a collection called ArrayCollection pebw. I've noticed that the ArrayCollections used as dataProviders for a LineGraph usually go as follows (for example):

private var expensesAC: ArrayCollection collection = new ArrayCollection ([] collection

{Month: "Jan", profit: 2000, expenses: 1500, amount: 450},

{Month: benefit "Feb": 1000, expenses: 200, amount: 600},

{Month: "Mar", profit: 1500, expenses: 500, amount: 300},

{Month: "ARP", profit: 1800, expenses: 1200, amount: 900},

([{Month: "May", profit: 2400, expenses: 575, quantity: 500}]) ;

who provides the data and labels. How can I activate my pewb, who has data such that week (which would be the horizontal axis), TotalEnergySpent and devices (which would have a line in the chart for each device) in a table like expensesAC?

OK just

You need browse these data everywhere where its come and then add it to the collection arrayCollection objects;

In a loop you would say;

[Bindable]

var pewb:ArrayCollection = new ArrayCollection()

for (var i: int = 0; i

Whenever you browse a new object is created and added to the arraycollection collection

var obj:Object = new Object()

obj. Week = "Jan";  share these values to the data source values.

obj. TotalEnergy = 2000;

obj. Devices = 100;

pewb.addItem (obj);

}

The arraycollection collection would be a collection of objects that the chart can then identify the fields that you want to use.

OK or not?

Tags: Flex

Similar Questions

  • How to dynamically generate text or all component areas?

    Hello

    I use Flex4 SDK and Flash Builder with eclipse plugin(trail version) for the development of a flex project.

    I have problems to dynamically generate text boxes.

    When I click on a link button, I want a text box to display on the screen. I tried a few examples that I found on the internet but without success.

    I appreciate your time.

    Thank you

    Ravi

    What error do you get?  Maybe try addElement instead of addChild

  • How to dynamically generate columns in conventional reports

    Hi all

    How to create dynamic columns in classic reports.

    I need to create these columns that depends on the difference of the date column start date and end date.

    for example: 4 November 2015 start_date and end_date is November 7, 2015

    I show the columns Day1, day 2, day 3 and day 4.

    and the values of these columns are checkboxes.

    Kind regards

    Arianne.

    Hi ujwala1234,

    ujwala1234 wrote:

    How to create dynamic columns in classic reports.

    I need to create these columns that depends on the difference of the date column start date and end date.

    for example: 4 November 2015 start_date and end_date is November 7, 2015

    I show the columns Day1, day 2, day 3 and day 4.

    and the values of these columns are checkboxes.

    The old packed timesheet application has the tip for how to display the day of the week selected by the user in the form of columns in the tabular presentation.

    Reference: old packages of timesheet Application

    That's how I'd do:

    • Select the range of dates populate the days between the date columns range in a collection of the APEX.
    • Display the columns as editable using the APEX_ITEM API.

    NOTE: Application of time sheets there was select list for weeks, so always the number of dynamic columns would be 7 + column code time.

    Also, the maximum number of modifiable columns, you can use on your page APEX is 50.

    Kind regards

    Kiran

  • How to dynamically generate where clause in Linq

    Hi all


    Oracle DB: 11 gR 2
    Oracle Client: 11.2.0.3.0 (ODP.NET)
    Oracle Developer Tools for Visual Studio
    VS 2010 (C#)

    In a Windows Form, it must query the data based on the values in list dropdown listboxes, which the user selects.
    Let's say two combox, one Department and one for salary
    Department:
    -1 all the
    10 Department 1
    20 Department 2
    30 Department 3

    Salary:
    -1 all the
    1 < 20000
    2 20000 to 50000
    3 50000 to 100000
    4 > 100000


    Here is the c# code to query data:
    using (var myEDMctx = new HREntities())
    {
    var LINQrslt = from emp in myEDMctx.EMPLOYEES
    Select emp;

    }


    The default values for the two combox should be everything.
    How to write dynamic where clause for this LINQ?

    Thanks in advance!

    That's what I do.

    var query = from c in customers
    Select c;

    If (where1 > - 1).
    Query = query. Where(c.Where1 > where1);

    If (where2 > - 1).
    Query = query. Where(c.where2 == where2);

    to return the query;

    Published by: Invincible on July 4, 2012 09:25

    Published by: Invincible on July 4, 2012 09:27

  • How to dynamically add data in a Spark list control

    Hi, I have a spark list in one of my custom components() control(id="Cclist") and a text input control. When a value is entered in the entry of the texts, I want to dynamically add the same in the list control. I tried to do the following:

    protected function Cc_selectHandler(event:CustomEvent):void

    {

     var cctext:DisplayObject = event.data as DisplayObject
    CcList.enabled = true;
    CcListButton.enabled = true;

    CcList.addChild(cctext);

    }

    But I get an error saying "addChild() is not available in this category.  "Instead, use addElement(), or change the skin. So I tried to use addElement, but apparently it is not available at all. No idea what im doing wrong?

    Add the text entered in the textinput to the dataProvider of the list in the appropriate format.

    A simple example:

    
    
        
            
        
    
        
            
        
    
        
            
        
        
        
        
    
    
  • How to make the data previously generated reuse vi?

    Attached VI is just a simple example for my problem. I want to generate some data (or read it thanks to a shared variable, etc, etc) and create statistics on these data. In this example, a histogram and value medium.

    Now, if I stop the VI & restart again, the first time that I generate a new data point, all old data is deleted the chart and indicators. I want to change my program, so he'll see actually yet all the data I have accumulated before the table.

    I know how to do for example in matlab:

    output = myfunction (output)

    so when I call this function, the first 'myfunction()' time it will generate the output array I can then move again on the next call so that the previously generated data will be used.

    So, how do I do that in Labview?

    Make a search for globals functional, which is based on the use of a shift register uninitialized for a while loop. You basically already have this if you simply delete the matrix constant which initializes the shift register holding the data table. It is a technique that was used before that global variables have been introduced. It's an old technique, but it is very effective and the basis for the Action engines. Jim Kring suggested a version no.-loop for LabVIEW 8.5.

    Note: You perform a comparison on floating-point values. As noted several times on this forum, it is doomed to failure because of how floating point numbers are stored in computers (this has nothing to do with LabVIEW).

  • How to execute dynamically generated using GR 11, 2 SQL statements?

    Hello

    I would like to know if it is possible to do what the following statement which is intended :
    select * from (select replace('select empno from emp',
                                 '',
                                 '') from dual);
    in other words, is it possible to dynamically generate and execute a select statement in a from clause?

    Thank you for your help,

    John

    Published by: 440bx 16 July 2010 15:57 modified 'create' to 'generate' to the subject

    Like many I know no. in SQL. Results of your query in the FROM clause will not be transformed as another query, but just a litral value and your outer query returns this value as "select empno from emp".

    But you can use dynamic sql statements in PL/SQL using EXECUTE IMMEDIATE or DBMS_SQL.

    Something like that.

    DECLARE
     dynamic_from_clause VARCHAR2(4000) := 'select empno from emp';
     vReturnVal NUMBER;
    BEGIN
      EXECUTE IMMEDIATE 'SELECT * FROM ('||dynamic_from_clause||')' into vReturnVal ;
    END;
    /
    

    Just write memory have not tested it.

  • How to save the data of different rates in a single VI?

    Hello

    I tried to acquire 2-channel measurement of voltage at 10 kHz and analyze data, finally to save the data to both 1 kHz and 1 Hz. What I did is this loop of producer/consumer use to do the work of recording at different rates. I have queued all the data in the main loop, and then removed the data and write it to the file in other loops. I added "wait = 1 ms' a consumer loop for recording data at 1 kHz (loop of fast logging) and added" wait = 1000ms' in another loop to get the slow 1 Hz (logging loop) data record.

    My problem is that the data record works fine in the case of 1 Hz, but it does not work for the case of 1 kHz. Although the time-out period defined as 1ms, the interval between two samples in the loop of fast data recording is about 100ms.  Subsequently, 1ms, 10ms, 100ms, 150ms tried in this loop to see what intervals are in these cases. I found that the intervals are same as assigned in the timeout greater than 100 ms, but if the time-out is set to 1ms or 10ms, the intervals are again around 100ms.

    My question is - why I can't reach data record 1 kHz using loop of consumers/producers, while the same way works for the case of 1 Hz?

    Thank you very much

    Hao

    You are sampling at 10 kHz and you want to back up your data "as if you sampled at 1 kHz and 1 Hz", if I understand correctly.  I also understand that you use the design of producer/consumer model to help with this (a good idea).

    I'm assuming that the producer 'product' a segment of data at a time, to say the value of a second of data or a 2 x 10000 I16 (assuming a 16-bit integer A/D) table you put into a queue and wait for the consumer.

    If you have data at 10 kHz, how do you get representations to 1 kHz or 1 Hz?  There are (at least) two possibilities - average data over the interval of proper time, or (re) sample data.  The good thing is that you can handle the situation 1 kHz and 1 Hz, essentially at the same time and in the same processing loop.  I'll discuss the case 1 kHz - with the assumptions I made, the case of 1 Hz becomes almost trivial.  I'll discuss treatment also just one channel, as it is similarly almost trivial to go from 1 to N-channel.

    If you have 1 second of data sampled at 10 kHz, and will "reduce" 1 second of data sampled at 1 kHz.  Note that you have 10 samples for each data point that you want in the end.  The "Averaging" method said "Replace all 10 points in the average of these 10 points", while "resampling" method said "replace 10 points with, say, the first point, ignoring the others.  An easy way to do this is to use the Reshape feature to transform an array of 10 x 1000 elements of your array of 10000 items 1-D 2D.  Now, you can use a loop FOR an average of 10 items or simply extract the first.  [This is where almost everyone, including me, a mistake - when you put a 10 x 1000 2D array in a loop, you get 10 iterations of 1000 items and we want 1000 iterations of 10 items.]  Oops, what to do?  [Simple - converts 2D array before sending in the loop FOR.]

    So when you have processed your 10,000 points and got both 1000 samples "1 kHz" and 1 "1 Hz" sample, you write each of them in their respective folder and wait for the next item in the queue of the consumer.  Consumer focus on the queue loop, it will automatically 'block', waiting for the producer of the 'feed' some data.  Note that the producer generates data once per second, producing 10000 points for the consumer in the process, but the time to deal with these points and perform the required disk i/o should take only a few milliseconds (certainly not more than 100, even if writing to a floppy!), so you don't have much time to do other interesting things (such as display data).

    Bob Schor

  • How urlencode dynamic parameter in the HTTPService url

    I created a small dashboard that uses a dynamic url for the HTTPService getting tha data for the chart. The url gets its querystring (a username) to the flashvars parameter in the wrapper. SRV. URL works great and fills in my table when the user name does not need to be encoded URL, but how can I urlencode the username that I need to do?

    This is an excerpt from the packaging:
    < script type = "text/javascript" >
    var flashvars = {};
    flashvars. UserName = 'Heather % 20% c3% 98zer ";

    Comment: I intend to dynamically generate the user name Although the above example is static. The user name is encoded in the wrapper.

    This is an excerpt from the source MXML:

    < s:Application creationComplete = "initVars ()" > "

    [Bindable]
    public var urlXML1:String;
    private function initVars (): void {}
    urlXML1 = FlexGlobals.topLevelApplication.parameters.UserName;
    SRV. URL ="http://myserver.com/xml/YourSales.aspx?UserName=" + urlXML1.toString ();
    SRV. Send();
    }

    < mx:HTTPService id = "srv" url = "/ >

    < mx:ColumnChart id = dataProvider = "{srv.lastResult.Data.Result"myChart"}"... "

    Comment: urlXML1.toString () above should be encoded. This is my problem in my opinion. I can't wait to hear your advice.

    Best regards Bo


    var objParam:Object = {};

    objParam ["UserName"] = urlXML1.toString ();

    SRV. "URL ="http://myserver.com/xml/YourSales.aspx ";

    SRV. Method = "GET";

    SRV. Send (objParam);

  • Dynamically generated movieclip properties

    Hello

    I'm reading in the data to an XML file. Each attribute of a child is assigned as a property of a movieclip as shown in the related code. However, I want to do is don't have not not the property will have already decided names that I don't necessarily know how to attribute a child in the xml file. Is it possible to dynamically name properties according to what number attribute, they are...?

    Thanks in advance

    Greg

    Yes it's possible... :)

    the docs have an example related directly to it, using the method "attributes()" (with the ') you can return a list of all the attributes of a node object to give in the form of an XMLList object. then iterate through this object, you can use the 'name()' method to return the name of each attribute. as you do this, you can use operators to access to dynamically generate the properties of the object of MC, and then assign the values in the other table, as in:

  • Numbers: Automatically generate data in one worksheet to another worksheet.

    By the numbers, how can you (or is it possible to) automatically generate data in a spreadsheet that is manually entered in another sheet?  For example, I want to track customer information in sheets 2-10 and I want specific data of these sheets to automatically fill the sheet 1 box so I can create an overview of the specific data in any of my clients.  As a dashboard of sorts.

    The devil is in the details here. Can you give more details?

    In general, I would say it will be much easier to enter your data at a specific location and then consolidate that extracts the "views" or "reports" it for each customer, to enter data for each client separately.

    But both ways are possible.

    SG

  • How to get api data to Analytics?

    Hi, I want to use the response to generate data for my js to customize and create a new report that does not build in obiee.

    Is there an api response data to call? How to get it?

    You have the Web service interface that allows you to run LSQL and retrieve data: http://docs.oracle.com/cd/E28280_01/bi.1111/e16364/methods.htm#BIEIT180

    Or if you just want to do a record in JS, you can always do in an analysis: using view narrative, you can pass the data from your analysis to a JS object and use any JS code, you want to do the rendering (OBIEE analysis is nothing other than the Web page in the end...)

  • How to create dummy data with 1 TB

    Hi Expert,

    May I know how to create dummy data with 1 TB to test performance. ?

    Respect of

    Liang

    what columns you want to include? Basically, you can generate as many lines as you like to connect by queries - something like:

    create the table big_t

    as

    with

    generator1 like)

    Select rownum id

    of the double

    connect by level<=>

    )

    ,

    generator2 as)

    Select lpad ('* ', 1000,' *') col1

    of the double

    connect by level<=>

    )

    Select g1.id

    g2.col1

    of generator1 g1

    generator2 g2

    ;

    Of course, it is not 1 TB, but you can change the number of levels. Who said: I think you need to find a sensitive table first structure.

  • XML schema to generate data from the table of data from a repeating subform

    Hi all, I would like to have a check box that when checked, allows you to hide a quote form and make a purchase order form visible, carrying a part of the field of the form of citation data in a new table on the order form. I have attached to this form to https://workspaces.acrobat.com/?d=pqpsXx5VPi * LkMeVKrX57w if you want to take a look. If the check box is cleared, he hid the PO form and to make quite visible.

    The idea behind this is that my client will create his quote and send t to his client. Once the customer accepts the quote, he simply click a button to generate its purchase order send it to its supplier.

    It seems that I have buttons to add lines on the submission form that the problem is more complex. I would be able to do it myself if the table has a fixed number of lines and I was able to use global fields, and naming each cell something different, but because it's a single repeating subform, I can't operate at all.

    I understand that, because it's a repeating subform that I need to create an XML schema to do this, but also can not know for the life of me how to create the schema. I read tons of tutorials, but no idea how to apply it to my specific needs. I've been able to find only info on how to bind the data source once it's been created.

    I would be eternally grateful if someone could help out me.

    Thank you!

    I edited your form and put it here.

    Here's what I did:

    • Script inserted into your box renamed someone who mask/displays the purchase order / sales quotation
    • I have included a script object with a function I wrote to transfer data from as named fields/subforms from one section to another
    • Inserted a few fields in your table of purchase order

    What you need to do is to complete the development of your purchase order table. Make sure that the common fields between the quote and purchase tables have the same name in order to transfer data.

    No necessary schema.

    Kyle

  • Need help filling single textfield with dynamic array data

    Hello

    I am filling a text field with a dynamic array data. So I know how many points are in the table with the instancemanager.count function. I need to help get the data from the dynamic table and insert into a field of text followed by a comma.

    Example:

    Dynamic table: row [1]: DATA_01

    line [2]: DATA_02

    rank [3]: DATA_03

    ...

    I would like to than the text box to automatically fill data in this format: DATA_01, DATA_02, DATA_03... and continue if there is more data.

    I started with the code below, but it does not work.

    var Count = form1.page2.DATA_history.instanceManager.count;

    var temp;

    for (var i = 0; i < Count; i ++)

    {

    Temp = xfa.resolveNode ("form1.page2.PO_history [" + i + "]"). DATA.rawValue;      This seems to get the last line only entry.

    this.rawValue = this.rawValue + temp;

    }

    I hope I was clear, but if someone need for clarification please ask. Thank you.

    Hello

    Try the following:

    var Count = form1.page2.DATA_history.instanceManager.count;

    var temp = "";

    for (var i = 0; i)

    {

    Temp = temp + xfa.resolveNode ("form1.page2.PO_history [" + i + "]"). DATA.rawValue + ",";

    }

    this.rawValue = temp;

Maybe you are looking for