# How to create a text box in a visualization in kibana vega

**URL:** https://discuss.elastic.co/t/how-to-create-a-text-box-in-a-visualization-in-kibana-vega/277256
**Category:** Kibana
**Tags:** vega
**Created:** [June 28, 2021, 5:09pm UTC](https://discuss.elastic.co/t/how-to-create-a-text-box-in-a-visualization-in-kibana-vega/277256 "2021-06-28T17:09:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Juan\_David\_Jaramillo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juan_david_jaramillo/32/76831_2.png) [@Juan\_David\_Jaramillo](https://discuss.elastic.co/u/Juan_David_Jaramillo)
#### Post date: [June 28, 2021, 5:09pm UTC](https://discuss.elastic.co/t/how-to-create-a-text-box-in-a-visualization-in-kibana-vega/277256/1 "2021-06-28T17:09:16Z")

</div>

Hello, I have a visualization in kibana - vega, I already made a graph, but now I want to add a text below the "Estado" bar, I do not know if there is the possibility of putting some text there already having a graph, I have not been able to do it, I need your help, I attach my code:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/7/4773196ebe24774639ee9f105a5fb8adffabde23.png)

```auto
{
  $schema: https://vega.github.io/schema/vega-lite/v2.json
  "config": {"view": {"height": 100, "width": 200}},
  "title": "Prueba Vega 1"
  data: {
    # URL object is a context-aware query to Elasticsearch
    url: {
      # The %-enclosed keys are handled by Kibana to modify the query
      # before it gets sent to Elasticsearch. Context is the search
      # filter as shown above the dashboard. Timefield uses the value 
      # of the time picker from the upper right corner.
      %context%: true
      %timefield%: @timestamp
      index: efecty*
      body: {
        size: 20
        _source: ["@timestamp", "Sysname", "RAMUsage","State","IP","Estatus"]
      }
    }
    # We only need the content of hits.hits array
    format: {property: "hits.hits"}
  },
  
    "transform": [
        {"calculate": "'https://72dfe17217744236af40cc31b704a664.us-central1.gcp.cloud.es.io:9243/s/efecty/app/kibana#/dashboard/bb33f960-80df-11eb-bca8-7bba65cbb959'","as": "web"}
      ],
  
 "encoding": {
        "x": {"field": "_source.Estatus", "type": "ordinal", "title": "Estado"},
        "y": {"field": "_source.Sysname", "type": "ordinal", "title": "Equipos"}
      },
      

      
    "layer": [
        {
        "selection": {"pts": {"type":"single"}}
          "mark": "rect",
          "encoding": {
            "color": {
              "field": "_source.State",
              "title": "Estado",
              "scale": {"scheme": "redyellowgreen"},
              "type": "quantitative",
            }
            
          "tooltip": [
            {"field": "_source.IP", "type": "ordinal", title: "Direccion"}
            {"field": "_source.@timestamp", "type": "ordinal", title: "Hora"}
            {"field": "_source.Estatus", "type": "ordinal", title: "Estado"}
          ]
          "href": {"field": "web"}
          }
        },
        {
          "mark": {"type": "text", "fontSize": 20, "dy": -5},
          "encoding": {
            "text": {"field": "_source.State"},
            "color": {"value": "black"}
          }
        },
        {
          "mark": {"type": "text", "fontSize": 15, "dy": 20},
          "encoding": {
            "text": {"field": "_source.Sysname"},
            "color": {"value": "black"}
          }
        }
      ]
      
        "marks": [
    {
      "type": "text",
      "encode": {
        "update": {
          "text": { "value": "Hello Vega!" },
  
      
        }
      }
    }
  ]
      
      
}

```

---

<div class="post-metadata">

### Author: ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)
#### Post date: [July 20, 2021, 1:49pm UTC](https://discuss.elastic.co/t/how-to-create-a-text-box-in-a-visualization-in-kibana-vega/277256/2 "2021-07-20T13:49:26Z")

</div>

Hi there, did you manage to find a solution to your problem?

---

<div class="post-metadata">

### Author: ![Juan\_David\_Jaramillo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juan_david_jaramillo/32/76831_2.png) [@Juan\_David\_Jaramillo](https://discuss.elastic.co/u/Juan_David_Jaramillo)
#### Post date: [July 21, 2021, 2:10pm UTC](https://discuss.elastic.co/t/how-to-create-a-text-box-in-a-visualization-in-kibana-vega/277256/3 "2021-07-21T14:10:07Z")

</div>

hello, I have not yet been able to add a text box.

---

<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: [August 18, 2021, 2:10pm UTC](https://discuss.elastic.co/t/how-to-create-a-text-box-in-a-visualization-in-kibana-vega/277256/4 "2021-08-18T14:10:23Z")

</div>

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