fixed js error, when there is only 1 data point