linear regression/trend line with ms charting
I have data that are numbers both on x and y and have charted them using mschart 4.0 [link text][1]

I need to add a trend line/linear regression to a bunch of points I have.  The data on x and y are both numbers (no dates anywhere), for instance (33.4,45.1) would be a point.

In the samples I downloaded from the first link I found a linear regression sample in the code files forecasting.aspx(.cs), and I found this ms documentation: [link text][2]

I have added a linear regression line to the chart with the following line (once all other data it setup etc)

    Chart1.DataManipulator.FinancialFormula(FinancialFormula.Forecasting, parameters, "Input:Y", "Forecasting:Y,Range:Y,Range:Y2");

The problem with both of these is that they assume dates are used.  I went ahead and implemented it anyway, but my regression line starts at around the x value of 20, and will go to an x value of the max x value of one of the points (almost 70) if I give the parameter Period a value of 700.  But since it doesn't start at x value 0 I don't trust it is correct.

Anyone have any idea on how to implement this?


  [1]: http://code.msdn.microsoft.com/mschart
  [2]: http://msdn.microsoft.com/en-us/library/dd456655.aspx
linear regression/trend line with ms charting
===

I have data that are numbers both on x and y and have charted them using mschart 4.0 [link text][1]

I need to add a trend line/linear regression to a bunch of points I have.  The data on x and y are both numbers (no dates anywhere), for instance (33.4,45.1) would be a point.

In the samples I downloaded from the first link I found a linear regression sample in the code files forecasting.aspx(.cs), and I found this ms documentation: [link text][2]

I have added a linear regression line to the chart with the following line (once all other data it setup etc)

    Chart1.DataManipulator.FinancialFormula(FinancialFormula.Forecasting, parameters, "Input:Y", "Forecasting:Y,Range:Y,Range:Y2");

The problem with both of these is that they assume dates are used.  I went ahead and implemented it anyway, but my regression line starts at around the x value of 20, and will go to an x value of the max x value of one of the points (almost 70) if I give the parameter Period a value of 700.  But since it doesn't start at x value 0 I don't trust it is correct.

Anyone have any idea on how to implement this?


  [1]: http://code.msdn.microsoft.com/mschart
  [2]: http://msdn.microsoft.com/en-us/library/dd456655.aspx