correctly display time series data, optimise results to render quicker