Fixed JS error on setting new data on initially empty series. Closes #1920.