Line-Best-Fit Mathematically searching for the line of best fit using Javascript. You can check the demo here.