# Display percentage growth on vertical bar

**URL:** <https://discuss.elastic.co/t/display-percentage-growth-on-vertical-bar/232489>\
**Category:** Kibana\
**Created:** [May 13, 2020, 5:22pm UTC](https://discuss.elastic.co/t/display-percentage-growth-on-vertical-bar/232489 "2020-05-13T17:22:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnkary](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@johnkary](https://discuss.elastic.co/u/johnkary)\
**Post date:** [May 13, 2020, 5:22pm UTC](https://discuss.elastic.co/t/display-percentage-growth-on-vertical-bar/232489/1 "2020-05-13T17:22:49Z")

</div>

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!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/0/00ebc250386bdded2d7dd5754827f2105b565a1f.png)

---

<div class="post-metadata">

**Author:** ![johnkary](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@johnkary](https://discuss.elastic.co/u/johnkary)\
**Post date:** [May 21, 2020, 8:01am UTC](https://discuss.elastic.co/t/display-percentage-growth-on-vertical-bar/232489/2 "2020-05-21T08:01:18Z")

</div>

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.

 ![rrrr](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bbafcbed9846fa8c639d756e06b69dcd3b0b43fd.png)

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [May 21, 2020, 8:02pm UTC](https://discuss.elastic.co/t/display-percentage-growth-on-vertical-bar/232489/3 "2020-05-21T20:02:18Z")

</div>

Hi there John!

There are a few different options for this, and this [blog post](https://www.elastic.co/blog/how-to-display-data-as-a-percentage-in-kibana-visualizations) 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](https://discuss.elastic.co/t/graph-with-percent-change-between-bucket/91204)

Let me know if those answer your question!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 18, 2020, 8:02pm UTC](https://discuss.elastic.co/t/display-percentage-growth-on-vertical-bar/232489/4 "2020-06-18T20:02:19Z")

</div>

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