How can I make a cumulative sum graph in grafana, from an elasticsearch data source?

Relevant info:

Grafana v5.4.2 (commit: d812109)
ElasticSearch version: 5.6.8

There is an ES index that is a log of events over time, and the events are categorised (per country). There is a grafana instance which has this ES index as a data source.

In grafana, I would like to make a graph over time of these events, such that the value for any given date on the x-axis would be the total number of events since the beginning of time until that time, reflected on the y-axis.

Basically, a normal, ordinary cumulative-sum graph.

I have read several tutorials, and nothing actually allows this. There is a lot of irrelevant information about showing cumulative sum on the tooltip, which is not useful to me.

Is this possible? If so, how can I do it?