process the data in reverse for the charts