# Custom text for Metric Chart items

**URL:** <https://discuss.elastic.co/t/custom-text-for-metric-chart-items/196291>\
**Category:** Kibana\
**Created:** [August 22, 2019, 9:57am UTC](https://discuss.elastic.co/t/custom-text-for-metric-chart-items/196291 "2019-08-22T09:57:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![girishpaik](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@girishpaik](https://discuss.elastic.co/u/girishpaik)\
**Post date:** [August 22, 2019, 9:57am UTC](https://discuss.elastic.co/t/custom-text-for-metric-chart-items/196291/1 "2019-08-22T09:57:54Z")

</div>

Hi Team,

I have developed a metric chart to get thread related data like status of the thread. In actual log, status is printed in single character (for Eg: 'Running' printed as 'R', 'Pending' printed as 'P', 'Continue Waiting' printed as 'CW' and 'Blocked' printed as 'B') when same brought to Kibana, it will be named as it is.  
Is it possible to change this caption to show what is actual status rather than single character?  
Please refer below screen shot:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/3/63003b586919b44ea0ab5906eb271b936a4405b1.png)

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [August 22, 2019, 3:32pm UTC](https://discuss.elastic.co/t/custom-text-for-metric-chart-items/196291/2 "2019-08-22T15:32:17Z")

</div>

You can create a [scripted field](https://www.elastic.co/blog/using-painless-kibana-scripted-fields) for your index pattern that converts the shortname ("CW") to the long name ("Continue Waiting"). Then you can use the scripted field in your visualization.

Here's an example that you can expand on.

```auto
if (doc['thread_state'].value == 'B') {
    return 'Blocked';
} else if (doc['thread_state'].value == 'CW') {
    return 'Continue Waiting';
} else if ...
return '';

```

---

<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:** [September 19, 2019, 3:32pm UTC](https://discuss.elastic.co/t/custom-text-for-metric-chart-items/196291/3 "2019-09-19T15:32:51Z")

</div>

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