Get historic data for graph