# Read Custom Label from plugin

**URL:** https://discuss.elastic.co/t/read-custom-label-from-plugin/108286
**Category:** Kibana
**Created:** [November 19, 2017, 1:58pm UTC](https://discuss.elastic.co/t/read-custom-label-from-plugin/108286 "2017-11-19T13:58:40Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![wkpv68](https://avatars.discourse-cdn.com/v4/letter/w/73ab20/32.png) [@wkpv68](https://discuss.elastic.co/u/wkpv68)
#### Post date: [November 19, 2017, 1:58pm UTC](https://discuss.elastic.co/t/read-custom-label-from-plugin/108286/1 "2017-11-19T13:58:41Z")

</div>

Hi

I use webinar\_plugins to create my own plugin (it is working great)  
I have one parameters that I need to enter manually and to received it when I press on the value.

I thought to add it to Buckets to Custom Label editor, my problem is that I don't succeed to read it from the plugin.  
metricDiv.addEventListener('click', () =\> {  
// NEED TO READ THE Custom Label text  
// HOW?  
}

See below code

const table = visData.tables[0];  
const metrics = [];  
let bucketAgg;

```
  table.columns.forEach((column, i) => {
           table.rows.forEach(row => {
      const value = row[i];
      const title = bucketAgg ? `${row[0]} ${column.title}` : column.title;

  

      const metricDiv = document.createElement('div');
      metricDiv.className = 'myvis-metric-div';

       metricDiv.addEventListener('click', () => {
               // NEED TO READ THE Custom Label text 
               // HOW?
       }

```

}

Thanks

---

<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 20, 2017, 6:03pm UTC](https://discuss.elastic.co/t/read-custom-label-from-plugin/108286/2 "2017-11-20T18:03:00Z")

</div>

I will ping the visualization engineer who worked on this. He an provide more insights 🙂  
cc / @ppisljar @thomasneirynck

Thanks  
Rashmi

---

<div class="post-metadata">

### Author: ![wkpv68](https://avatars.discourse-cdn.com/v4/letter/w/73ab20/32.png) [@wkpv68](https://discuss.elastic.co/u/wkpv68)
#### Post date: [November 20, 2017, 6:22pm UTC](https://discuss.elastic.co/t/read-custom-label-from-plugin/108286/3 "2017-11-20T18:22:01Z")

</div>

Thanks a lot, it is very important for me.  
The custom label is not must, I can. Read also from option tab.

I need to read a string from visualization plugin (from custom label or option tab)

Thanks again

---

<div class="post-metadata">

### Author: ![wkpv68](https://avatars.discourse-cdn.com/v4/letter/w/73ab20/32.png) [@wkpv68](https://discuss.elastic.co/u/wkpv68)
#### Post date: [November 21, 2017, 8:51am UTC](https://discuss.elastic.co/t/read-custom-label-from-plugin/108286/4 "2017-11-21T08:51:24Z")

</div>

I succeed to read from option tab  
vis.params.ZZZ

Thanks

---

<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 21, 2017, 4:09pm UTC](https://discuss.elastic.co/t/read-custom-label-from-plugin/108286/5 "2017-11-21T16:09:07Z")

</div>

Thanks for updating the thread.

Rashmi

---

<div class="post-metadata">

### Author: ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)
#### Post date: [November 21, 2017, 4:35pm UTC](https://discuss.elastic.co/t/read-custom-label-from-plugin/108286/6 "2017-11-21T16:35:05Z")

</div>

thats correct, to get it from options tab you can access it on `vis.params.yourparametername`

to read the custom label, you can read it from `vis.aggs`

- find the aggregation you are interested in .... like Count or something you set in your settings
- call `makeLabel()` on it

---

<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 19, 2017, 4:35pm UTC](https://discuss.elastic.co/t/read-custom-label-from-plugin/108286/7 "2017-12-19T16:35:11Z")

</div>

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