Display percentage growth on vertical bar

Hi all! I have the following vertical bar diagram on Kibana visualization and i want to add on it percentage progress between months (bars). Is there somehow a way to do this;

Thank you in advance!

Here, I thought of creating a script-field. But, how can I convert this to painless language, in order to calculate percentage growth of the field 'hectares' between 2 docs, actually, current month vs previous month?

  • A code something like this:
    [( doc['hectares.keyword'].value - doc['hectares.keyword'].hectares_of_previous_month ) / doc['hectares.keyword'].hectares_of_previous_month )] * 100

As it seems in the screenshot below i want to 'catch'
the MAX value of 'hectares' of the previous month e.g April with value 7,358 and calculate the percentage growth of the current month (May)
with value 8,433 and put it to the filed 'pgrowth_hect'. Now i have there some manual dummy values.

Hi there John!

There are a few different options for this, and this blog post outlines several of them.

You can also use a Timelion visualization for this, this is probably one of the most straightforward approaches. Here is an example from another user: Graph with percent change between bucket

Let me know if those answer your question!