المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Ho to draw a regression line in windows forms charts?



C# Programming
02-03-2013, 02:53 AM
Hey guys, I have pretty much figured out my regression line doing some calculations, but drawing it is where I am stuck. The line comes from the y axis and goes through the middle of the chart roughly, once I get these two points I draw the line, but I do not know how to draw a line THROUGH the middle point to the end of the chart, can anyone please help me out?

Here is my chart code:

chart1.Series["Regression Line"].Points.AddXY(0, b0); chart1.Series["Regression Line"].Points.AddXY(xAverage, yAverage); chart1.Series["Regression Line"].ChartType = SeriesChartType.Line; chart1.Series["Regression Line"].Color = Color.Red;
You can see the line goes from one point to another, but its only half the line, any assistance would be greatly appreciated I am completely stumped!

Many thanks!!!