Elastic/Grafana Graph Increment and Decrement running counts

I have alarm set and alarm clear events stored in Elastic.

I would like to show the ramp up and ramp down of these over time.

What calculation do I need to plot this in a time series graph ?