Best fitting line

Please excuse the horrible Javascript and user interface design.