Can I create a cumulative average line on visualization?

Hi, I'm trying to calculate a cumulative average on visualization but I cant find how.
For example, if I have a data set like this:

Data= {1, 2, 3, 4, 5} which describes the monthly total number of data

and want to draw a line with data like this:

{1 / 1}
{( 1 + 2 ) / 2}
{( 1 + 2 + 3 ) / 3}
{( 1 + 2 + 3 + 4 ) / 4}
{( 1 + 2 + 3 + 4 + 5) / 5}

Is this possible?

I can't think of a way to do this at the moment. The tricky bit is knowing how many buckets to divide by, and I can't find a way to do that purely with aggregations. If there is a way, I suspect it'll be pretty convoluted. However I think it would be pretty trivial to implement on the client side since we already support the cumulative sum aggregation. Feel free to open an enhancement request on the Kibana github repo: https://github.com/elastic/kibana/issues/new

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.