Added JavaScript error messages and inserted code to automatically resize the graph.