Added a check for an empty number of points in the linegraph.