How to create a linear regression line series

I am relatively new to Flex and I am currently working with charts in the data visualization components. It has been requested that I add a linear trendline (ie, linear regression trend line) to a column chart. From what I can tell, there is no linear regression form for the mx:LineSeries. Has anyone created a linear trendline using the data visualization components in Flex, or does anyone have any suggestions on how to accomplish this?

Nicholas @ Bime posted a solution to this sort of problem earlier this year, apparently. He created a custom component that extends the CartesianDataCanvas, and can be called as an annotation element of the chart. See the following url: http://bimehq.com/data-visualization/introducing-flex-charting-trend-line-component/
His solution works very well, with the only caveat being if you have mutiple series on your chart, all the trendlines will be the same color, and there is no label on the lines to show which line corresponds to which series.

Similar Messages

  • 50G / simultaneous multiple scatter plots + intersection of linear regression lines

    I have a real specific problem with scatter plots and linear regression lines.
    First, I've been looking over the manual and the internet trying to figure out how to graph multiple scatter plots at the same time, but it seems like you can only do Columns 1 and 2 or Columns 1 and 3, etc., from Edat (greek letter), you can't do all three columns at once IF Column 1 represents X and 2 and 3 represent Y-values.  Or columns 1 & 2 as one set, and 3 & 4 as a second set. 
    Further, because it doesn't seem to be able to do this, I can't get it to find the intersection of these two lines. I can get the x-intercept and y-intercept just fine but I don't need that. What I can do is do a linear regression on both sets of data to get an equation for a line, put it into an array, and use the solver on it, that does indeed work. But that's a whole lot of extra keypresses just to get an ordered pair. I have experience on TI and Casio calculators and they don't have this seeming limitation. 
    Any suggestions?

    I have a real specific problem with scatter plots and linear regression lines.
    First, I've been looking over the manual and the internet trying to figure out how to graph multiple scatter plots at the same time, but it seems like you can only do Columns 1 and 2 or Columns 1 and 3, etc., from Edat (greek letter), you can't do all three columns at once IF Column 1 represents X and 2 and 3 represent Y-values.  Or columns 1 & 2 as one set, and 3 & 4 as a second set. 
    Further, because it doesn't seem to be able to do this, I can't get it to find the intersection of these two lines. I can get the x-intercept and y-intercept just fine but I don't need that. What I can do is do a linear regression on both sets of data to get an equation for a line, put it into an array, and use the solver on it, that does indeed work. But that's a whole lot of extra keypresses just to get an ordered pair. I have experience on TI and Casio calculators and they don't have this seeming limitation. 
    Any suggestions?

  • How can create and change PCA line items.

    How can create and change PCA line items.
    Please tell me the process and t.codes.

    If you are in version < 4.7 ee then use 9KE0 tcode for passing profict center entries or trasnafer of balances from one profit center to another.
    If you are in new GL regular FI entry like FB50 will hold good for account types "S"

  • How to create a dynamic multi-line function in SQL Server

    I am attempting to create a Multi-Line Function in SQL Server that accepts a dynamic WHERE clause as a parameter. I need this so that the function can be as versatile as possible for the filter that needs to be applied. I am unfortunately getting an error
    upon creation of the function.  I don't know how to solve the problem. Can someone advise me?
    SQL:
    SET
    ANSI_NULLSON
    GO
    SET
    QUOTED_IDENTIFIERON
    GO
    -- =============================================
    -- Author:
    -- Create date: 2/3/2014
    -- Description: This multiline function will accept a generic WHERE Clause and apply it to the query for return.
    -- =============================================
    CREATE
    FUNCTIONTESTMULTILINEFUNCTION
    @WHEREvarchar(1024)
    ,@CHANGEDDATEasdatetime
    RETURNS
    @TESTTABLE
    TABLE
    IDint
    ,REVint
    AS
    BEGIN
    Declare@SQLSTRINGvarchar(4096)
    SET@SQLSTRING=''
    SET@SQLSTRING=@SQLSTRING+'SELECT
    REVS.ID, REVS.Revision
    FROM
    Select distinct result.ID, Max(Rev) as ''''Revision''''
    FROM
    Select * from dbo.BugsAll
    where
    [Changed Date] < @CHANGEDDATE
    ) result
    GROUP BY result.ID
    ) REVS
    join dbo.BugsAll BA on (BA.ID=REVS.ID AND BA.REV=REVS.revision)'
    IF
    (@WHEREisnotnullOR@WHERE<>'')
    BEGIN
    SET@SQLSTRING=@SQLSTRING+'
    WHERE '+@WHERE;
    END
    INSERT@TESTTABLE
    EXEC
    (@SQLSTRING)
    RETURN
    END
    GO
    ERROR:
    Msg 443, Level 16, State 14, Procedure TESTMULTILINEFUNCTION, Line 44
    Invalid use of a side-effecting operator 'INSERT EXEC' within a function.
    Senior Test Lead -- Microsoft

    >> Unfortunately I really need to form a dynamic query in a table valued function on the SQL SERVER. I have another tabled valued function that needs something returned as a table in order to further join the data. I am not allowed to use Stored
    Procedures in that function. <<
    You do know that real SQL programmers hate the proprietary nightmare of tabled valued functions?  This is how you procedural programmers avoid learning set-oriented declarative and functional programming. 
    Your mindset wants to write to a scratch tape or disk file (aka “tabled valued function result table”) just like you did BASIC, FORTRAN or COBOL. QL programmers do not have to materialize their data. We can use VIEW or a drive table as well as a base table. 
    >> Plus, there are occasions where I don't want to pass in a field [sic: columns are not fields] parameter or need to change a parameter list such that I don't wish the table function to filter by a particular field [sic] or other setting. <<
    What you want is a magical “Automobiles, Squids and Lady Gaga” function. An SQL programmer might write a complex VIEW then do simpler SELECTs off it. 
    >> My application pushes the WHERE clause from EXCEL to SQL to do the hard work as EXCEL is not the application in which I want to process the SQL statement and pass it via ODBC. I cannot run macros in Excel on the web.<< 
    This is a crazy language system. Usually we fetch data in SQL and then pass it to a math package, report writer, etc. We never keep logic (aka WHERE clauses) outside the database. 
    >> I am bummed about the fact that this feature doesn't work. It will up my server management costs to maintain unique tabular based functions based on WHERE clause query <<
    So stop writing those “tabular based functions”, change your mindset and start learning SQL and do it right. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • How to create a "traveling route" line on a map from point A to point B!

    Can someone explained or show me how I to create a clip (it will have a background map of Europe) depicting a “traveling route” line from point A to point B. The “traveling route” line I would like to display follows a Bezier curve path; it would start from point A (as a “dash”) and progressively the dash line lengthens until it reaches point B.
    To expand my request further - can one add a plane or ship icon (image) as the start “header” (starting from point A), move along the Bezier curve path and spits out the trailing “dashes” to form the “traveling route” line?
    I have seen this done on occasions, but I’m unable to create such clip. You help is appreciated.
    I’m using Premiere 6.5 and After Effect 5.5
    You can email me at [email protected]

    I don't remember which site, but I think I have a link to a tutorial site that includes that
    Go to my Adobe notes http://www.pacifier.com/~jtsmith/ADOBE.HTM
    Click on the Tutorial section and check the various sites
    Added
    You should never post a clear email address... spammers use software to harvest such
    Put something like
    myname at partone dot com

  • Alv - how to create a broader header line?

    I'm using the 'TOP_OF_PAGE' parameter within 'AVL_GRID_DISPLAY' FM in connection with 'REUSE_ALV_COMMENTARY_WRITE' to create a Header Line for the List-display.
    My Problem is, that I really need to get a broader header with approx. 120 characters but the only structure, 'REUSE_ALV_COMMENTARY_WRITE' seems to allow is 'slis_listheader' which is only three fields broad with 80 characters.
    I need a line with 6 fields and 120 to 150 characters - how can i possibly submit that to the function module, or somehow different to 'TOP_OF_PAGE'...?
    Thanks, Clemens

    Clemens
    I think you will have to format the header yourself.
    The problem is that you need to have a pointer to the document (cl_dd_document class) so you can modify it as you want. The only way I found is to use I_CALLBACK_HTML_TOP_OF_PAGE parameter when you call REUSE_ALV_GRID_DISPLAY.
    Unortunately, the form specified in I_CALLBACK_TOP_OF_PAGE parameter for REUSE_ALV_GRID_DISPLAY FM is not being called with any parameters. Therefore can't be used to create your heading.
    Now, you need to call your FM like this:
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_HTML_TOP_OF_PAGE = 'TOP_OF_PAGE1'
    ...other parameters....
    then you will need to create that FORM:
    FORM TOP_OF_PAGE1 USING p_doc type ref to cl_dd_document.
    DATA: mytoptext(255) TYPE C.
    CONCATENATE 'This is my very long text. Probably about 140 chars long'
      'or more just to check if it all appears as is. Hopefully with a bit'
      'of luck we might have some success here.'
      into mytoptext separated by space.
    CALL METHOD p_doc->new_line.
    CALL METHOD p_doc->add_text
        EXPORTING text  = mytoptext.
    ENDFORM.
    I advise that you have a look on the original SAP FM (REUSE_ALV_GRID_COMMENTARY_SET), which is used to format your commentary (through memorised parameter DYNDOS_FOR_ALV) and based on that you can make your heading.
    If you can't use I_CALLBACK_HTML_TOP_OF_PAGE parameter then probably defining your own grid is a solution (a bit longer to implement, though).
    Hope this helps.
    Wojtek

  • How to create tab in two lines

    Greetings,
    Created set of tabs. but they are displaying in a single line e.g Orientation Sales Day. it is apperaing in a single line and i want to display in two lines like
    "Orientation
    Sales Day"
    How i will achive this target ?
    Guide pls

    Hi,
    Looking at your example at http://apex.oracle.com/pls/apex/f?p=18686:1:561273670565801::::: posted on {thread:id=2423720}.
    /i/themes/theme_1/images/bg-tabs-r.gif image is only 35 pixel tall, so you will need to increase the height of this image.
    Similarly, you will need to increase the heights of /i/themes/theme_1/images/bg-tabs-current.gif and /i/themes/theme_1/images/bg-tabs-non-current.gif . Maybe you have to increase the height to 80 or 90 pixels. It is not going to look good on the page.
    Get yourself FF/Firebug or some such tool to inspect the HTML DOM and you will be able to see for yourself that the label of the tab is indeed wrapping with &lt;br /> , its just that the images ( and a result the display area) are not big enough to show the complete label.
    Cheers,

  • How to create the no of line items in a PO

    Hi Sir,
    Please tell me how can i restrict the no of line items to be created in a PO say 20. where i have to do that.
    Regards,
    Krishan

    Hi Krishan
    I think u can not restrict the no of line items to be created in a PO in std SAP .U take a help of the ABAP ppl . They can write a program in such a way that in the ME21N, program checks
    the number of line items copied from purchase requisition,If it is more than 10, it should issue an error message.
    Regards
    Anjali

  • How to create elastic effect on line

    Hi guys,
    i am working on an application that i plan to use as an Lightweight IDE.
    This is a small project that i just started.
    My question ..
    i need to create an elasticity effect... like a 'line streching' effect that can be seen in one of the IDE's called BLUEJ .
    The on 'lt click' is pressed mouse pointer can strech a line and when the 'lt click' is left a line is drawn.
    im using JInternalFrame on JDesktopPane. Is it possibe to do so.
    All help will be appreciated
    Regards
    Naren

    Maybe something along the lines of detecting mouse dragged with a MouseListener, saving the origin of the mouse click and then keep drawing a line from the origin to the current location of the mouse. Probably by calling repaint() and then override the paintComponent() method to draw the line.

  • How to create multiple report header line?

    Dear Experts!
    I am creating a report, which needs multiple lines for report header e.g. First row should have Report Name in bold. Then next line should have the month for which the report was executed and last line should have the person, who executed it.
    I know that I can get the text of these values by text variable but the problem is to format it and to put the text in different report header lines.
    Please help!
    Thank you,
    Tyagi

    Dear Tyagi,
    Are you using BEx Report Designer?
    You can use drag-and-drop for moving the fields. Just click on the cell and as the buttons appear, move it to your destination cell.
    Regards, Karol - SAP BI Development

  • How to Create dynamic checkbox in line item

    Dear all,
            In selection-screen i have using select-options  If i select select-option range, the output  will display dynamic check box in line item what range i have select above select options.
    Regards,
    Baskaran.

    Hi,
    After fetching data into table, find the number of internal table entries using Describe statement.
    Then, use Do loop till w_count becomes w_lines( no. of entries ) incrementing the count for every item.

  • How to create trend line in cfchart?

    I can create a scatter chart in cfchart - but I do not know how to create a linear regression trend line in the same chart as a second data series. Kodemonki provided an answer in a forum discussion a few years ago (http://forums.adobe.com/message/192848#192848) - but I am not able to make it work (I have a dangerously small knowledge of coldfusion and statisitcal formulas). Can someone tell me where i put in my to data query variables - such as for a query that gives results for two data fields, "Item1" and "Item2".
    Here is Kodemonki's solution:
    <!--- The min setting is a preference based on how you want the data to be displayed. --->
    <!---<cfset min = arrayMin(grabData["value"]) - 5>--->
         <cfset min = 0>
         <cfset max = ceiling(arrayMax(grabData["value"])) + 1>
         <cfset n = grabData.recordCount>
         <cfset sum_x = 0>
         <cfset sum_x2 = 0>
         <cfset sum_xy = 0>
         <cfloop from="1" to="#grabData.RecordCount#" index="i">
              <cfset sum_x = sum_x + i>
              <cfset sum_xy = (i*grabData.value[i]) + sum_xy>
              <cfset sum_x2 = sum_x2 + (i*i)>
         </cfloop>
         <cfset sum_y = arraySum(grabData["value"])>
         <cfset slope = round(((n*sum_xy) - (sum_x*sum_y))/((n*sum_x2) - (sum_x*sum_x)))>
         <cfset intercept = round((sum_y - (slope*sum_x))/n)>
         <cfset best_fit = QueryNew("id, value")>
         <cfloop from="1" to="#grabdata.RecordCount#" index="i">
              <cfset queryAddRow(best_fit)>
              <cfset value = round((slope*i) + intercept)>
              <cfset QuerySetCell(best_fit, "id", grabData.xlabel[i])>
              <cfset QuerySetCell(best_fit, "value", value)>
         </cfloop>
         <cfchart scalefrom="#min#" scaleto="#max#" title="#GrabDatapointInfo.label#" format="jpg" chartHeight="450" chartwidth="500" xaxistitle="Month/Year">
              <cfchartseries type="line" query="best_fit" valuecolumn="value" itemcolumn="id"/>
              <cfchartseries type="line" query="grabData" valuecolumn="value" itemcolumn="xlabel"/>
         </cfchart>

    Have you read the docs for CFCHART, CHCHARTSERIES, etc?  Did you mess around with the example code sufficiently so you understand how the tags work?
    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-79 30.html
    Adam

  • How to create a trend line in cfchart?

    I  can create a scatter chart in cfchart - but I do not know how to create  a linear regression trend line in the same chart as a second data  series.
    Kodemonki provided an answer in a forum discussion a few years  ago (http://forums.adobe.com/message/192848#192848).
    But I am not able to make it work (I have a dangerously small  knowledge of coldfusion and statisitcal formulas).
    Can someone tell me  where i put in my to data query variables - such as for a query that  gives results for two data fields, "Item1" and "Item2".
    Thanks!
    Here is Kodemonki's solution:
    <!--- The min setting is a preference based on how you want the data to be displayed. --->
    <!---<cfset min = arrayMin(grabData["value"]) - 5>--->
         <cfset min = 0>
         <cfset max = ceiling(arrayMax(grabData["value"])) + 1>
         <cfset n = grabData.recordCount>
         <cfset sum_x = 0>
         <cfset sum_x2 = 0>
         <cfset sum_xy = 0>
         <cfloop from="1" to="#grabData.RecordCount#" index="i">
              <cfset sum_x = sum_x + i>
              <cfset sum_xy = (i*grabData.value[i]) + sum_xy>
              <cfset sum_x2 = sum_x2 + (i*i)>
         </cfloop>
         <cfset sum_y = arraySum(grabData["value"])>
         <cfset slope = round(((n*sum_xy) - (sum_x*sum_y))/((n*sum_x2) - (sum_x*sum_x)))>
         <cfset intercept = round((sum_y - (slope*sum_x))/n)>
         <cfset best_fit = QueryNew("id, value")>
         <cfloop from="1" to="#grabdata.RecordCount#" index="i">
              <cfset queryAddRow(best_fit)>
              <cfset value = round((slope*i) + intercept)>
              <cfset QuerySetCell(best_fit, "id", grabData.xlabel[i])>
              <cfset QuerySetCell(best_fit, "value", value)>
         </cfloop>
         <cfchart  scalefrom="#min#" scaleto="#max#" title="#GrabDatapointInfo.label#"  format="jpg" chartHeight="450" chartwidth="500"  xaxistitle="Month/Year">
              <cfchartseries type="line" query="best_fit" valuecolumn="value" itemcolumn="id"/>
              <cfchartseries type="line" query="grabData" valuecolumn="value" itemcolumn="xlabel"/>
         </cfchart>

    Have you read the docs for CFCHART, CHCHARTSERIES, etc?  Did you mess around with the example code sufficiently so you understand how the tags work?
    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-79 30.html
    Adam

  • How to create radiant background?

    I'm hoping this is a RTFM question, but I'm tying to create a radiant background similar to these slides (http://blog.duarte.com/wp-content/uploads/2009/02/one-idea.jpg). I know how to create a linear gradient fill, but I can't seem to figure out how to create a radiant one.

    Put a shape behind everything and with it selected:
    +Inspector > Graphic (5th tab) > Fill > Advanced Fill > 2nd box under gradient bar+
    Peter

  • SHOW / HIDE -  line series using checkbox

    how do i show & hide a line series based on checkboxes?
    tried applying series id- doesn't seem to work!
    Any Body!

    thanks that worked oddsy,
    now im facing problem to show the hidden series through
    actionscript
    im doing something like this:
    while generation i hide the series
    pasting the function for reference:
    public function addSeries(series:Array, yField:String,
    id:String, color:uint,dp:ArrayCollection,vis:Boolean):void
    var ls:LineSeries= new LineSeries();
    var stroke:Stroke = new Stroke()
    ls.yField = yField;
    ls.xField="ts"
    ls.dataProvider=dp
    stroke.color = color;
    stroke.weight = 1.5;
    ls.setStyle("lineStroke", stroke);
    ls.alpha=.8
    ls.visible=vis
    ls.id=id
    var temp:Array = series;
    temp.push(ls);
    series = temp;
    mychart.series = series;
    thru action script i try this : if checkbox selected do -
    > mychart.series[0].visible=true ,
    mychart.series[1].visible=true....so on
    but it doesn't show the series! what shud i do?

Maybe you are looking for

  • USB Host Controller not recognized by Windows 7.

    Just installed Windows 7 in a1130n desktop.  The USB Host Controller and the Std USB Host Controller are not recognized by the operating system.  The USB ports and the media memory ports on the front panel will not work.

  • Change music to non DRM format

    After a very long time with apple products I have had to switch to an adnroid phone.  Now I am finding that half my music is stuck on the computer becuase it is DRM protected.  Is there a way to get that protection off the songs, I am very annoyed wi

  • FireWire drives don't mount

    Hello everybody, my trusted LaCie 500GB and 250GB drives worked flawlessly since I bought them. Since two days they are not mounting. About a monthe ago I upgraded from 10.3.9 to 10.4.7. Everything worked fine. I very frequently repair permissions an

  • How to control read/unread status of email

    I would like to be able to simply view (in the preview pane) emails without them being marked as 'read'. Is there a way to do this in the Mac mail client (Snow Leopard)? When I actually open the email, it would then be marked as 'read'. Outlook for W

  • Learn SAP Human Resource Management Module

    Hello, I am new on this website. I would like to know which are the methods to learn or to be trained to use SAP/HR (Human resources).I contacted SAP company in France where I live and the fees are about 17000 euros, they are crazy, i thought it was