# Overall average line in a chart

**URL:** <https://discuss.elastic.co/t/overall-average-line-in-a-chart/63304>\
**Category:** Kibana\
**Created:** [October 18, 2016, 2:27pm UTC](https://discuss.elastic.co/t/overall-average-line-in-a-chart/63304 "2016-10-18T14:27:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jettro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jettro/32/3418_2.png) [@jettro](https://discuss.elastic.co/u/jettro)\
**Post date:** [October 18, 2016, 2:27pm UTC](https://discuss.elastic.co/t/overall-average-line-in-a-chart/63304/1 "2016-10-18T14:27:41Z")

</div>

Hi,  
I am creating a chart in Timelion to show a bar chart with the amount of docs (requests) per day. In this chart I would like to add a horizontal line with the average of docs per day over all buckets. I can determine this average using pipeline aggregations. But I would really like to do this in Timelion. Does anyone have an idea how to do this? Below is the query I can use to obtain the **avg\_daily\_visits**.

```
GET raw_events-*/_search
{
  "size": 0,
  "aggs": {
    "by_day": {
      "date_histogram": {
        "field": "createDate",
        "interval": "day"
      }
    },
    "avg_daily_visists": {
      "avg_bucket": {
        "buckets_path": "by_day>_count" 
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [October 18, 2016, 3:58pm UTC](https://discuss.elastic.co/t/overall-average-line-in-a-chart/63304/2 "2016-10-18T15:58:02Z")

</div>

This isn't currently possible with Timelion. However it is something we are working on at the moment.

---

<div class="post-metadata">

**Author:** ![rashid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashid/32/12566_2.png) [@rashid](https://discuss.elastic.co/u/rashid)\
**Post date:** [October 18, 2016, 5:01pm UTC](https://discuss.elastic.co/t/overall-average-line-in-a-chart/63304/3 "2016-10-18T17:01:38Z")

</div>

And when @shaunak says "at the moment" he literally meant at this extra very moment. Like now. Like here it is:

For Kibana 4.x:

> **[rashidkpc/timelion-extras](https://github.com/rashidkpc/timelion-extras/tree/4.x)**
>
> All my extra functions for timelion that I, for whatever reason, haven't gotten into core. - rashidkpc/timelion-extras

For Kibana 5:

> **[rashidkpc/timelion-extras](https://github.com/rashidkpc/timelion-extras/tree/master)**
>
> All my extra functions for timelion that I, for whatever reason, haven't gotten into core. - rashidkpc/timelion-extras

See the `README.md` for installation instructions. I didn't publish a package for them, but installing from Github is easier than frosting a cupcake. Which, I guess if don't bake much, might seem intimidating, but I assure you, both installing that plugin and frosting a cupcake are very easy.

![](https://us1.discourse-cdn.com/elastic/original/2X/0/05c1ff801a9e80d59e08acac4ccd95d2050b5eba.png)

Plus, you get a bonus function, `.orderby()` which orders a multi-series list by one of the same functions as `.aggregate()`, or by the label of the series.

Enjoy.

---

<div class="post-metadata">

**Author:** ![jettro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jettro/32/3418_2.png) [@jettro](https://discuss.elastic.co/u/jettro)\
**Post date:** [October 18, 2016, 5:51pm UTC](https://discuss.elastic.co/t/overall-average-line-in-a-chart/63304/4 "2016-10-18T17:51:41Z")

</div>

Cool, going to try it, I'll figure out later on what is easier. Baking the cup cake or adding it to my installation 🙂

---

<div class="post-metadata">

**Author:** ![jettro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jettro/32/3418_2.png) [@jettro](https://discuss.elastic.co/u/jettro)\
**Post date:** [October 18, 2016, 6:08pm UTC](https://discuss.elastic.co/t/overall-average-line-in-a-chart/63304/5 "2016-10-18T18:08:35Z")

</div>

I got the following warning when doing what is stated in the readme:

`log [17:58:24.801] [warning] Plugin "timelion-extras" was disabled because it expected Kibana version "0.1.0", and found "5.0.0-rc1".`

As it turns out, you have to change the **version** in the package.json from 0.1.0 to the version you are using. **5.0.0-rc1** in my case. Then restart Kibana and it worked perfectly for me. I am happy 🙂

---

<div class="post-metadata">

**Author:** ![rashid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashid/32/12566_2.png) [@rashid](https://discuss.elastic.co/u/rashid)\
**Post date:** [October 18, 2016, 7:35pm UTC](https://discuss.elastic.co/t/overall-average-line-in-a-chart/63304/6 "2016-10-18T19:35:58Z")

</div>

Whoops, missed that. I updated the [README.md](http://README.md), thanks!

---

<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:** [July 6, 2017, 1:36pm UTC](https://discuss.elastic.co/t/overall-average-line-in-a-chart/63304/7 "2017-07-06T13:36:20Z")

</div>


