In part 2 of this two part tutorial describes the calculation of the slope and the y intercept of the line and draws the line on the chart.