Currently, the Cumulative Sum aggregation only works with a bucket path that is a histogram or date histogram. There are some situations where it is desirable that the bucket path is a terms aggregation. An example of this is when you want to build a pareto chart which is what one opportunity is trying to do. This would be a great enhancement for IoT and failure analysis.
The workaround to this is to use Vega. Having done this, it is semi complicated. If this were baked into Elasticsearch (and therefore Kibana). It would be a few very simple clicks to create one. It took me multiple hours to build it in Vega.
From talking to @polyfractal there is a PR to add a gap_policy: none which relates to this. The caveat is that the pipelines would assume whatever order is used by the terms aggregation... this could be nonsensical as a derivative across terms doesn't make much sense.
CC: @polyfractal