This is one of the applications on which I worked at the Princeton Plasma Physics Laboratory from September 2013-June 2014. The file is located here:
examples---> basic-usage ---> Graph w Line.html
The user would enter in x and y coordinates of the data they are plotting, and the graph automatically plots and updates the axes based on the data. If the user wants to add more data, the table automatically inserts another row.
Additionally, the user can plot a line in the form y=mx+b. Based on the parameters of the line, the program calculates the coefficient of determination, a value which measures how accurately the given line approximates the data. The most accurate R^2 data is saved and displayed to the user.