BarGauge status with Total Time for PACKML application


I want to implement production dashboard.
I have a machine I register every 1sec the status.

I want to do a dashboard where I can select beteween 2 dates and display in this selection how many time machine is in each status.

My datas are in a sqlserver table

I don’t find the way to adjuste the MAX value of the gauge to represent the total time of the selection

Can you help me ?