Only fill dataset if there are points in it

otherwise it will fail since dataset.points[dataset.points.length - 1].x will be dataset.points[-1] .x