# Adding label for different parts of timelion

**URL:** <https://discuss.elastic.co/t/adding-label-for-different-parts-of-timelion/156789>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [November 15, 2018, 6:06am UTC](https://discuss.elastic.co/t/adding-label-for-different-parts-of-timelion/156789 "2018-11-15T06:06:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueSpirit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bluespirit/32/44056_2.png) [@BlueSpirit](https://discuss.elastic.co/u/BlueSpirit)\
**Post date:** [November 15, 2018, 6:06am UTC](https://discuss.elastic.co/t/adding-label-for-different-parts-of-timelion/156789/1 "2018-11-15T06:06:21Z")

</div>

I am using **.min** method in kibana timelion. My string is something like this:  
`.es().bars(stack=false).color(#F44336), .min(.es(), 25).bars(stack=false).color(#8BC34A)`  
This is taken from [https://www.elastic.co/blog/timelion-tutorial-from-zero-to-hero](https://www.elastic.co/blog/timelion-tutorial-from-zero-to-hero)

Now, I am able to create this graph but unable to label the 2 parts correctly.

 ![kibana-deller](https://us1.discourse-cdn.com/elastic/original/3X/8/2/821f718b294f0a5de2cac9bb5674614ee7f06a5c.png)

Also, if I use **.label('my label')** it only works for the green part, not the red part.  
I want to label both of them individually.

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [November 16, 2018, 4:14am UTC](https://discuss.elastic.co/t/adding-label-for-different-parts-of-timelion/156789/2 "2018-11-16T04:14:48Z")

</div>

I have not experimented much with labels in Timelion, but I can cross link to a post which explains generation of Timelion labels dynamically .. hope this helps,

> [@Timelion: how generate .label() dynamically?](https://discuss.elastic.co/t/timelion-how-generate-label-dynamically/85072):
>
> Hi, I am using split function in timelion to do a term aggregation and to produce mutliple lines by grouping. The query is quite long and I want to set a custom label, which includes fields of the query. Example: I split for the filed type. That gives me 3 lines, one for (type1, type2, type3) Now I want to set a custom lable, which should be as following: "my very own static text" [type] So this should result into: my very own static text type1 my very own static text type2 my very ow…

Cheers  
Rashmi

---

<div class="post-metadata">

**Author:** ![BlueSpirit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bluespirit/32/44056_2.png) [@BlueSpirit](https://discuss.elastic.co/u/BlueSpirit)\
**Post date:** [November 16, 2018, 9:11am UTC](https://discuss.elastic.co/t/adding-label-for-different-parts-of-timelion/156789/3 "2018-11-16T09:11:41Z")

</div>

Thank you!!  
That is useful, but not in my case. I ended up creating the same graph with a different approach. I used **.if()** clauses for creating graphs.

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [November 16, 2018, 3:07pm UTC](https://discuss.elastic.co/t/adding-label-for-different-parts-of-timelion/156789/4 "2018-11-16T15:07:33Z")

</div>

Am glad your solution worked for your case. Thanks for sharing.

Rashmi

---

<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:** [December 14, 2018, 3:07pm UTC](https://discuss.elastic.co/t/adding-label-for-different-parts-of-timelion/156789/5 "2018-12-14T15:07:56Z")

</div>

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