Trend line in scatter chart

Hi,
Is it possible to add a trend line to an existing scatter chart?
Thanks.
Andy

The Regression/Trend Line is calculated using the Least Squares Regression method. You can get all the information on what goes into the calculations for Least Squares Regression on wikipedia.
Then create an actionscript class (its not particularly complicated) that does the Least Squares Regression calculations on a series of x and y observations (that you used to create your plot chart).
Once you have calculated the Least Squares Regression data for your plot series, you add a line series to your plot chart. Each observation in the lineSeries data should use the x value (independant variable) from the plot data and the calculated y value from your Least Squares Regression class.

Similar Messages

  • Dynamic trend line on flash chart

    Hi,
    How could we reference an apex item on the custom XLM chart? I intend to add a dynamic trend line using
    <objects>
    <line value="&PXX_." text="trend line" color="0xFF0000" thickness="1" alpha="100"/>
    </objects>
    but it doesn't work. Could somebody guide me to the right direction.
    And to add, anybody have integrated or call an statistical process control (SPC) chart in apex?
    Thanks in advance.

    You can create a process, create the entire XML string in the process, and set the resulting XML string in the Custom XML area. We did something similar and seems to be working fine.
    Ravi

  • Best fit Line on scatter chart

    Hi,
    I am trying to draw best fit line over two points using the formula y=mx+c.
    I have the following data,
    consider x=68, y=23 and a=82, b=30
    I interchanged the above values and form the points to plot
    basically using the above (x,y,a and b) I constructed (x,y),(a,y),(x,b) as points to plot.
    68,23 (x,y)
    82,23 (a,y)
    68,30 (x,b)
    I created a scatter chart based on the value, Now I want to draw the line only between (a,y) and (x,b).
    Is this achievable using any other chart or ways?
    Any help highly appreciated.
    Thanks,
    Vino

    Hi,
    Any input on this please.
    Thanks,
    Vino

  • Strange Ideal Trend Line in burndown chart

    I am getting a very strange idealtrend line in my burn down chart. The project has 400 hours of work in it, but the ideal trend starts at 100 hours. THis places 300 hours above the ideal trend, which looks very weird.
    I would like to understand how the beginning point of the ideal trend line is calculated, perhaps this will help me figure out what is going on.
    any help would be appreciated.

    Hi,
    You can
    download the Agile Process Template to your local machine , and in the Reports folder, you can find the Burndown - Dashboard.rdl.  You can open this file using SQL Server Business Intelligence Development Studio or just notepad.exe.
    In the rdl file, The IdealTrend Series is calculated as
    =IIF (Parameters!TrendLineParam.Value = "both" OR Parameters!TrendLineParam.Value = "ideal",
    Code.Burndown
    IIF
    ( Parameters!YAxis.Value = "hours",
    Sum(Fields!Cumulative_Remaining_Work.Value),
    Sum(IIF(Fields!System_State.Value<>Parameters!ClosedName.Value, Fields!Cumulative_Count.Value, 0))
    Fields!DateValue.Value,
    Parameters!EndDateParam.Value
    Nothing
     And Code.Burndown is defined as
    Private firstValue As Double = Double.NaN
    Private firstDate As Date
    Private lastState As String
    Private numDays As Integer
    Function Burndown(ByVal val As Object, ByVal valDate As Date, ByVal endDate As Date)
    If valDate &lt; firstDate Then
    firstValue = Double.NaN
    firstDate = DateTime.MinValue
    End If
    If Double.IsNaN(firstValue) Then
    If Not val Is Nothing And val &lt;&gt; 0 Then
    firstValue = val
    firstDate = valDate
    numDays = Math.Max(1, (endDate - valDate).Days)
    Return firstValue
    End If
    Else
    Return ((endDate - valDate).Days / numDays) * firstValue
    End If
    Return Nothing
    End Function
    From the Burndown function, when firstValue is NaN, the value is set to the parameter
    val, and the series pass Sum(Fields!Cumulative_Remaining_Work.Value) as the parameter
    val, so the beginning point of the ideal trend line is calculated as Sum(Fields!Cumulative_Remaining_Work.Value)
    Best regards,
    Ruiz
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

  • Add a trend line to a scatter graph

    for my physics work i had to plot a graph and i need to add a trendline to the graph. I have plotted the graph as a scatter chart but dont know how to add a line of best fit, please help

    Search "linear regression' in Numbers Help.
    The FORECAST() function can be used to calculate the end points for the trend line using the minimum and maximum X values in your data set for the x value argument.
    For example, with your data pairs listed in B3:B12 (x values) and C3:C12 (y values), add these values and formulas:
    D3: 0
    E3: =FORECAST(D3, C3:C$12, B3:B12)
    D4: =MAX(B3:B12)
    E4: =FORECAST(D4, C3:C$12, B3:B12)
    The data pair on row 3 mark the y axis intercept of the trend line.
    The pair on line 4 mark the position of the trend line where its x value is equal to the maximum x value of the data set. As plotting this pair may obscure the data point at this x value, you may want to move the trend line point to the right. To do this, add an arbitrary amount to the value in D4. The size of the added amount will depend on the scale of your graph.
    eg. D4: =MAX(B3:B12)+2
    If your data set includes negative x values, replace the formula in D3 with the mirror of the one in D4:
    D3: =MIN(B3:B12)-2
    Again, the "-2" is an arbitrary value used to extend the trend line beyond the collected x values.
    This will allow you to plot these two points onto your scatter graph as a second data set. I don't see a means of making Numbers connect the points, so you will have to add the line manually.
    Regards,
    Barry

  • Displaying a trend line (in line chart) in SSRS

    We have a line graph which plots the actual data points (x,y), everything is working fine with this graph. Now we need to add a trend line to this existing graph after going thro. the articles we came to know that there is no direct option in SSRS to draw a trend line. So we need to calculate the trend values ourselves which we need to plot as atrend line. This trend line is similar to the trend line which comes in Excel chart, do anyone know how to calculate the trend values from the actual data points. We got through several formulas, but were not clear, have anyone tried out exactly the same, if so please help us out by providing an example to calculate the trend values.

    The default functionality of Reporting Services does not support trend lines.  There are some additional tools you can purchase to achieve this though, which is talked about in the first link below.
    You can take a look at this post:  http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1148970&SiteID=1
    and this one:  http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=322398&SiteID=1
    Jarret

  • Combine Line and Scatter types in Apex chart

    Hi,
    Can anyone help me create a chart which has features of both Line and Scatter types.
    i.e. Is it possible to join points in a Scatter chart?
    I am using Apex 4.1
    Thanks
    Bruceter

    Thanks for the suggestions Howard.
    I have searched the forum and found a few similar queries, but no obvious solutions.
    I may have to try something like the approach suggested by Hilary in the Re: Multi-series chart setting the series type - combine scatter and line thread.
    A common application for this functionality would be time-series plots (with irregular measurement times).
    Thanks
    Bruceter

  • How to add lines to scatter/bubble chart?

    Hi,
    I have bubble and scatter charts for which I'd like to add some horizontal lines, such as sales goals. Anyone?
    Appreciate any suggestions/ideas.

    FileWriter(String fileName, boolean append) throws IOException
    If append is true, then output is appended to the end of the file. Here is an example:
    import java.io.*;
    public class  AATest1
         public static void main(String args[])
              try
                   //Open file for writing:
                   File data = new File("C:\\TestData\\javaIO.txt");
                   BufferedWriter out = new BufferedWriter(
                                  new FileWriter(data) );
                   out.write("hello");
                   out.close(); //flushes buffer
                   //Open file for appending:
                   out = new BufferedWriter(
                        new FileWriter(data, true) );
                   out.write(" world");
                   out.close(); //flushes buffer
              catch(IOException exc)
                   System.out.println("io error writing to file");
    }

  • 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

  • Numbers 3.1 restricting the period for moving average trend lines

    Numbers 3.1 is restricting the period I can specify for a moving average trend line for a scatter plot series. The max is 6. This limitation was not present in the previous version of Numbers.
    Charts imported from the previous version retain larger periods, but there is no way I can see to specify periods >6 for any new series. Is there a way to allow a period >6? That is clearly necessary for many applications.
    Thanks.

    Hi Bill,
    Numbers 3.1
    If you want a 14 day moving average over the prior 14 days, the formula in C10 is
    =AVERAGE(B2:B15) (and Fill Down)
    The formula will eventually run out of cells. Hence the red error triangles.
    Plotting columns A, B and C:
    X axis is Day (column A)
    Blue circles and blue line are Actual Y (column B and as expected, they jump around).
    Black circles and black line are calculated moving averages on a 14 day period (column C)
    Red line is Numbers Trendline (Moving Average, Period 6). How it predicts into the future (Moving Average over 6 days) I have no idea.
    I would more trust a calculated moving average, because I know what it is calculating.
    Regards,
    Ian.

  • How can I label data points in a scatter chart with text strings?

    Post Author: Bill B
    CA Forum: Charts and Graphs
    I need to create a Scatter Chart, with a text label for each data point instead of the xy coordinates. A legend will no longer be necessary.Also, I want to draw "cross-hair" lines on both the x and y axes centered on one particular data point.Any ideas?

    Post Author: ebobo
    CA Forum: Charts and Graphs
    Hi
    I have the same problem here, did you find any solutions.
    Here we are ok if the dimension is displayed in the scatter instead of the measurements but the only options i founds was "Show data" and that option displays the values of the xy.
    pls let me know if anybody found any solution for this problem

  • Scatter chart with two series?

    I have a table showing my cat's weight each day. (He's on a much needed diet and it's important to make sure he's losing weight, but not more that about 1% per week, as I experiment with his diet.) I created a scatter chart with the date on the X axis and his weight on the Y axis, and I made a 7 day moving average trendline to show his progress with most of the random daily fluctuations evened out. So far so good.
    I added a column to the chart with a function showing what his weight would be each day if it decreased 1% per week from the average of the previous week. I would like to add this column of data as a second series on the scatter chart so I can make sure he's not losing weight too fast. But I can find no way to do this.
    I had no trouble showing both series on a line chart. But no luck with the scatter chart. I tried creating a new scatter chart using all three columns of data, and I tried dragging the third column of data to the original scatter chart.
    Is it really possible that Numbers '09 cannot show two data series on a scatter chart? Or is there a way to do it?
    Thanks for any assistance.
    Bill

    Hi Bill,
    Maybe this will help. A Scatter Chart displays data pairs, such as a date and a weight. A single column of data would be only one half of the data-pair set. Select both the X and Y value columns for the second set and then add to the Scatter chart.
    Jerry

  • Can You Create Trend Line in CFCHART?

    Have pretty much got CF7 Charts and WebCharts3D down, at
    least to the point where they can do what I need the most. However,
    the one thing I'd like to be able to do, but not sure if it's
    possible, is create a TREND LINE.
    This would be a LINE charts with 2 series. The first series
    would be a line with the actual counts covering a period of time.
    I'd like to add a 2nd line, using the same data from the
    first series, but have it displayed as a TREND line. In Excel, you
    can easily create a TREND line, it's even offered as an option.
    I've seen somehwere (CFCHART or WebCharts3D) something to so
    with "logarithmic" options, which is one of the options for Excel
    charts.
    Two more quick questions:
    Q1. Is there any way to control the margin between the left
    and right borders of the charts, and the bars? Have tried
    experimenting, but can't seem to get this to work. Reason is, when
    I try to show a chart in 3D, the first bar on the left is "butted
    up" against the left chart border. Would like to add a little space
    there.
    Q2. Rather than display rectangular bars, I'd like to display
    rounded cylinders. I've tried setting the chart type in CFCHART to
    "cylinder" but it still displays a bar. When I try to change the
    type to "cylinder" in WebCharts3D, the chart STILL displays
    rectangular bars. Yet I've seen many examples of rounded, cylinder
    bars.
    Don't mean to push my luck with too many questions. Thanks
    for any advice, help.
    Gary

    Trend Lines:
    CFChart does not do trend lines of any type. However, it is
    not too difficult to compute the regression of your choice and to
    plot it as a second series.
    Logarithmic:
    Not sure what you are asking here.
    In theory, cfchart does do log-lin and log-log charts.
    However, it is so buggy, and the scaling problems are so
    great, that we have never been able to get it to work well.
    We use ChartDirector for anything that requires a log scale.
    Side margins:
    You cannot control these directly. Here are some workarounds:
    For "Category" axis:
    Make sure the "isBucketed" property is set to true (this is the
    default).
    If that is not enough, add extra bars to your data series,
    usually value zero. It's not ideal but it may be good enough.
    For "Scale" axis:
    Usually this works well enough. Otherwise, try toggling the
    "isAbsolute" property.
    The only other recourse is to manually scale the plot using the
    "scaleMin" and "scaleMax" properties. This can be a real pain for
    obvious reasons and also because cfchart scaling is fraught with
    bugs and "quirks".
    Cylinder Bars:
    These work. Perhaps there was a setting conflict within the
    XML or between the CFChartSeries setting and the XML?
    Also the cylinders will only look round when 3D is turned on.
    (Side view of a cylinder is just a shaded bar.)
    Anyway, I've said it before: cfchart is barely usable for a
    very limited range of charts.
    For real business or common engineering and scientific needs,
    you need to step up to something better.
    The package we use (has all the features and very reasonably
    priced) is ChartDirector (
    http://www.advsofteng.com/cdcoldfusion.html).
    (And, no, I'm not affiliated.)

  • Line Time Series Chart not working

    Hi All,
    I have one Line Time Series chart where on the X Axis i have taken one date and on Y axis one Sales Figure.Now on the Measure Lables i have taken on dimension as Customer.
    So the chart will give me something like trend which customer has how much sales figures daywise.
    Now the issue is that it shows the trend for one customer correct and shows the line but if i select second customer the graph doesnt show the line just dot for the second customer.
    Any help in this regard

    Thanks Vinod for the reply.
    Second customer doesnt have data on consecutive days but there is no pattern in that.He has data on 3rd,7th,8th,10th,15th day.
    But for all these days for the second customer dots are coming but not in the case for First Customer.
    Regards

Maybe you are looking for

  • Smartview Office Error (Unable to Save)

    If anyone is able to shed some light on the following issue then it would be great. As I'm sure that many of the Hyperion users have experienced this painstaking issue. We are using Smartview for Office (Excel) and what I've notice is that when we ar

  • Why no "Places" for imported photos?

    Right now, most of my photos on the iPhone were imported using Photo Stream (which means they were taken on the iPhone, saved to my computer, then reimported to the iPhone using Uploads in Photo Stream.)  The iPhone will not display the "Place" for a

  • How to integrate adobe flash widgets from Adobe captivate with Adobe Presenter?

    Hi all, We are a group of students who are creating a number of flash widgets that allows them to create e-learning  activities. We are creating specific widgets in Flash  for use in Captivate and then the results of the widgets in Adobe Presenter. T

  • Trouble loading cds in iTunes

    CDs that play fine elsewhere will not load in iTunes - after a few seconds, the disc ejects.  This is not consistent since many other discs load just fine.  Any assistance would be appreciated.

  • Really new to Weblogic - trying to install WAR

    Hi, I am really new to Weblogic, and I am trying to get a web application that I've been given to work with Weblogic 8.1 on Windows 2000 Server. I just installed Weblogic 8.1 today, then I've configured a Weblogic configuration. I then copied the WAR