# Labeling in vega lite

**URL:** https://discuss.elastic.co/t/labeling-in-vega-lite/251022
**Category:** Kibana
**Tags:** vega
**Created:** [October 5, 2020, 3:41pm UTC](https://discuss.elastic.co/t/labeling-in-vega-lite/251022 "2020-10-05T15:41:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![suibgui](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@suibgui](https://discuss.elastic.co/u/suibgui)
#### Post date: [October 5, 2020, 3:41pm UTC](https://discuss.elastic.co/t/labeling-in-vega-lite/251022/1 "2020-10-05T15:41:18Z")

</div>

Hello,

i have this eureur when showing value in labels in side my horizantal bar .

this is my code :  
"layer": [{  
"mark": "bar"  
}, {  
"mark": {  
"type": "text",  
"align": "right",  
"xOffset": -4,  
"aria": false  
},  
"encoding": {  
"text": {"field": "result", "type": "nominal"}  
}  
}]  
 ![vega](https://us1.discourse-cdn.com/elastic/original/3X/a/0/a030df7f15b1ffd508e5453513630a0526119522.png)  
thank you for help .

---

<div class="post-metadata">

### Author: ![cheiligers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheiligers/32/73114_2.png) [@cheiligers](https://discuss.elastic.co/u/cheiligers)
#### Post date: [October 6, 2020, 7:30pm UTC](https://discuss.elastic.co/t/labeling-in-vega-lite/251022/2 "2020-10-06T19:30:14Z")

</div>

@suibgui I'm not sure what the issue is you're trying to resolve. Do you want the labels in your horizontal bars not to show or is it the way they are showing up that's the problem?  
If it's the way they are showing up and you want them to display to the right, try the following:

1. Change `"align":"right"` to `"align":"left"`
2. Add an `"xOffset": <some positive value>` where gives you enough space to render your longest string
3. Change your encoding test type according to what you need as per the [docs](https://vega.github.io/vega-lite/docs/type.html)  
I tried these settings using the vega editor:  
 ![Screen Shot 2020-10-06 at 12.28.26](https://us1.discourse-cdn.com/elastic/original/3X/9/2/92e0d48b9c258368872e8bcc7ef7b4e28b4333c2.png)

While we _technically_ don't support using vega-lite but try to help where we can 😄 . I'm not a Vega expert but the docs are pretty good. Here's a quick link to the documentation for [marks](https://vega.github.io/vega-lite/docs/mark.html#mark-def)

---

<div class="post-metadata">

### Author: ![suibgui](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@suibgui](https://discuss.elastic.co/u/suibgui)
#### Post date: [October 7, 2020, 2:16pm UTC](https://discuss.elastic.co/t/labeling-in-vega-lite/251022/3 "2020-10-07T14:16:06Z")

</div>

hi @cheiligers,

tha same problem,

thank you

---

<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: [November 4, 2020, 2:16pm UTC](https://discuss.elastic.co/t/labeling-in-vega-lite/251022/4 "2020-11-04T14:16:10Z")

</div>

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