Javascript: Doing logarithmic regression with .js, and plotting the results