Creating TOTAL based on historic flow rate data (1 second sample rate)

Hello All.
Has anyone created a way to grab a range of data from a chart and totalize the values from it? I need to create a TOTAL GALLONS value from flowmeters rate values that are being stored every second.
Client is hoping to select a range on a chart and have a total gallons valve displayed.

Any ideas?

Thanks