# Dynamic labels

**URL:** <https://discuss.elastic.co/t/dynamic-labels/119448>\
**Category:** Kibana\
**Created:** [February 12, 2018, 10:09am UTC](https://discuss.elastic.co/t/dynamic-labels/119448 "2018-02-12T10:09:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DannyM](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@DannyM](https://discuss.elastic.co/u/DannyM)\
**Post date:** [February 12, 2018, 10:09am UTC](https://discuss.elastic.co/t/dynamic-labels/119448/1 "2018-02-12T10:09:57Z")

</div>

How can I dynamical edit the labels from a pie chart?

I have a pie chart with web response codes. it would be nice to script something to edit the shown labels from the pie chart so I can add some comments like:

if (statuscode = 200){  
pieLabel.set "200 - OK"}

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [February 12, 2018, 4:54pm UTC](https://discuss.elastic.co/t/dynamic-labels/119448/2 "2018-02-12T16:54:21Z")

</div>

@DannyM you can use the Filters aggregation to do something similar, hopefully this screenshot provides proper explanation:

 ![39%20AM](https://us1.discourse-cdn.com/elastic/original/3X/c/5/c5c491e8851ec2a2e1512ce3f9eb3e2f9a499d7c.png)

---

<div class="post-metadata">

**Author:** ![DannyM](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@DannyM](https://discuss.elastic.co/u/DannyM)\
**Post date:** [February 14, 2018, 3:28pm UTC](https://discuss.elastic.co/t/dynamic-labels/119448/3 "2018-02-14T15:28:14Z")

</div>

Hi Brandon,

Thank you for your answer,

it's not the whole answer i expected but it's a nice trick.

only thing left for me is i cant describe al codes so the most used i wil label but how can i show the remaining as code without adding a filter

so I label 200-ok and 404-error now i also want to display the unkown other codes comming in.

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [February 14, 2018, 3:44pm UTC](https://discuss.elastic.co/t/dynamic-labels/119448/4 "2018-02-14T15:44:36Z")

</div>

@DannyM you can also use a [Scripted Field](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html) in Kibana to do this and you can write whatever code you want to determine these labels.

---

<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:** [March 14, 2018, 3:44pm UTC](https://discuss.elastic.co/t/dynamic-labels/119448/5 "2018-03-14T15:44:46Z")

</div>

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