# X-axis is not visible in vega kibana while calling through index

**URL:** <https://discuss.elastic.co/t/x-axis-is-not-visible-in-vega-kibana-while-calling-through-index/263088>\
**Category:** Kibana\
**Created:** [February 3, 2021, 8:04am UTC](https://discuss.elastic.co/t/x-axis-is-not-visible-in-vega-kibana-while-calling-through-index/263088 "2021-02-03T08:04:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saumya1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saumya1/32/87139_2.png) [@saumya1](https://discuss.elastic.co/u/saumya1)\
**Post date:** [February 3, 2021, 8:04am UTC](https://discuss.elastic.co/t/x-axis-is-not-visible-in-vega-kibana-while-calling-through-index/263088/1 "2021-02-03T08:04:55Z")

</div>

{  
"$schema": "[https://vega.github.io/schema/vega/v5.json](https://vega.github.io/schema/vega/v5.json)",

"autosize":"none",  
"height":"350",  
"width":"300",  
"padding":"30"

"title": {  
"text": "Sample incident data",  
"subtitle": "timeunit test",  
"subtitleFontStyle": "italic",  
"frame": "group",  
"anchor": "start",  
"offset": 10  
},

"signals": [  
{  
"name": "timeunit", "value": ["day"],  
"bind": {"input": "select", "options": [  
["year"], ["month"], ["date"], ["day"], ["hours"]  
]}  
}  
],  
"data": [  
{  
"name": "incidents",  
url: {  
index: samptuint  
body: {  
\_source: ["date", "ticket", "priority", "inc\_num", "status"]

```
    }
    format: { property: "hits.hits" }
 "transform": [
    {
      "type": "timeunit",
      "field": "date",
      "units": {"signal": "timeunit"},
      "signal": "tbin"
    },
    {
      "type": "aggregate",
      "ops": ["count"],
      "fields": ["inc"],
      "as": ["inc"],
      "groupby":["unit0"]
    }
  ]
}

```

],

"scales": [  
{  
"name": "xscale",  
"type": "band",  
"range": "width",  
"padding": 0.05,  
"round": true,  
"domain": {"signal": "timeSequence(tbin.unit, tbin.start, tbin.stop)"}  
},  
{  
"name": "yscale",  
"type": "linear",  
"range": "height",  
"domain": {"data": "incidents", "field": "inc"},  
"zero": true,  
"nice": true  
}  
],  
"axes": [  
{ "orient": "bottom", "scale": "xscale",  
"formatType": "time", "format": {"signal": "timeUnitSpecifier(tbin.units, {hours: '%H'})"} },  
{ "orient": "left", "scale": "yscale" }  
],

"marks": [  
{  
"type": "rect",  
"from": {"data": "incidents"},  
"encode": {  
"update": {  
"x": {"scale": "xscale", "field":"unit0"},  
"width": {"scale": "xscale", "band": 1},  
"y": {"scale": "yscale", "field": "inc"},  
"y2": {"scale": "yscale", "value": 0},  
"tooltip": {"signal": "{timeunit: timeFormat(datum.unit0, timeUnitSpecifier(tbin.units)), inc\_count: format(datum.inc, ',')}"}  
},  
"hover": {  
"fill": {"value": "firebrick"}  
}  
}  
}  
]  
}  
Response in spec(vega debug)  
{  
"$schema": "[https://vega.github.io/schema/vega/v5.json](https://vega.github.io/schema/vega/v5.json)",  
"description": "A bar chart of flight statistics, aggregated by the selected time unit.",  
"autosize": {  
"type": "none",  
"contains": "padding"  
},  
"height": "350",  
"width": "300",  
"padding": "30",  
"title": {  
"text": "Sample incident data",  
"subtitle": "timeunit test",  
"subtitleFontStyle": "italic",  
"frame": "group",  
"anchor": "start",  
"offset": 10  
},  
"signals": [  
{  
"name": "timeunit",  
"value": [  
"day"  
],  
"bind": {  
"input": "select",  
"options": [  
[  
"year"  
],  
[  
"month"  
],  
[  
"date"  
],  
[  
"day"  
],  
[  
"hours"  
]  
]  
}  
}  
],  
"data": [  
{  
"name": "incidents",  
"format": {  
"property": "hits.hits"  
},  
"transform": [  
{  
"type": "timeunit",  
"field": "date",  
"units": {  
"signal": "timeunit"  
},  
"signal": "tbin"  
},  
{  
"type": "aggregate",  
"ops": [  
"count"  
],  
"fields": [  
"inc"  
],  
"as": [  
"inc"  
],  
"groupby": [  
"unit0"  
]  
}  
],  
"url": {  
"index": "samptuint",  
"body": {  
"\_source": [  
"date",  
"ticket",  
"priority",  
"inc\_num",  
"status"  
]  
}  
},  
"values": {  
"took": 0,  
"timed\_out": false,  
"\_shards": {  
"total": 1,  
"successful": 1,  
"skipped": 0,  
"failed": 0  
},  
"hits": {  
"total": 14,  
"max\_score": 1,  
"hits": [  
{  
"\_index": "samptuint",  
"\_type": "\_doc",  
"\_id": "ue3lR3cBmDhuxKMfAKQP",  
"\_score": 1,  
"\_source": {  
"date": "01-01-2012 23:00:00"  
},  
"unit0": null,  
"unit1": null  
},  
{  
"\_index": "samptuint",  
"\_type": "\_doc",  
"\_id": "uu3lR3cBmDhuxKMfAKQP",  
"\_score": 1,  
"\_source": {  
"date": "03-22-2012 20:00:00"  
},  
"unit0": null,  
"unit1": null  
},  
{  
"\_index": "samptuint",  
"\_type": "\_doc",  
"\_id": "u-3lR3cBmDhuxKMfAKQP",  
"\_score": 1,  
"\_source": {  
"date": "02-01-2012 23:00:00"  
},  
"unit0": null,  
"unit1": null  
},  
{  
"\_index": "samptuint",  
"\_type": "\_doc",  
"\_id": "vO3lR3cBmDhuxKMfAKQP",  
"\_score": 1,  
"\_source": {  
"date": "04-02-2012 23:00:00"  
},  
"unit0": null,  
"unit1": null  
},  
{  
"\_index": "samptuint",  
"\_type": "\_doc",  
"\_id": "ve3lR3cBmDhuxKMfAKQP",  
"\_score": 1,  
"\_source": {  
"date": "04-13-2012 23:00:00"  
},  
"unit0": null,  
"unit1": null  
},  
{  
"\_index": "samptuint",  
"\_type": "\_doc",  
"\_id": "vu3lR3cBmDhuxKMfAKQP",  
"\_score": 1,  
"\_source": {  
"date": "01-04-2018 23:00:00"  
},  
"unit0": null,  
"unit1": null  
},  
{  
"\_index": "samptuint",  
"\_type": "\_doc",  
"\_id": "v-3lR3cBmDhuxKMfAKQP",  
"\_score": 1,  
"\_source": {  
"date": "04-21-2016 23:00:00"  
},  
"unit0": null,  
"unit1": null  
},  
{  
"\_index": "samptuint",  
"\_type": "\_doc",  
"\_id": "wO3lR3cBmDhuxKMfAKQP",  
"\_score": 1,  
"\_source": {  
"date": "02-02-2016 23:00:00"  
},  
"unit0": null,  
"unit1": null  
},  
{  
"\_index": "samptuint",  
"\_type": "\_doc",  
"\_id": "we3lR3cBmDhuxKMfAKQP",  
"\_score": 1,  
"\_source": {  
"date": "03-03-2016 20:00:00"  
},  
"unit0": null,  
"unit1": null  
},  
{  
"\_index": "samptuint",  
"\_type": "\_doc",  
"\_id": "wu3lR3cBmDhuxKMfAKQP",  
"\_score": 1,  
"\_source": {  
"date": "01-01-2018 23:00:00"  
},  
"unit0": null,  
"unit1": null  
}  
]  
}  
}  
}  
],  
"scales": [  
{  
"name": "xscale",  
"type": "band",  
"range": "width",  
"padding": 0.05,  
"round": true,  
"domain": {  
"signal": "timeSequence(tbin.unit, tbin.start, tbin.stop)"  
}  
},  
{  
"name": "yscale",  
"type": "linear",  
"range": "height",  
"domain": {  
"data": "incidents",  
"field": "inc"  
},  
"zero": true,  
"nice": true  
}  
],  
"axes": [  
{  
"orient": "bottom",  
"scale": "xscale",  
"formatType": "time",  
"format": {  
"signal": "timeUnitSpecifier(tbin.units, {hours: '%H'})"  
}  
},  
{  
"orient": "left",  
"scale": "yscale"  
}  
],  
"marks": [  
{  
"type": "rect",  
"from": {  
"data": "incidents"  
},  
"encode": {  
"update": {  
"x": {  
"scale": "xscale",  
"field": "unit0"  
},  
"width": {  
"scale": "xscale",  
"band": 1  
},  
"y": {  
"scale": "yscale",  
"field": "inc"  
},  
"y2": {  
"scale": "yscale",  
"value": 0  
},  
"tooltip": {  
"signal": "{timeunit: timeFormat(datum.unit0, timeUnitSpecifier(tbin.units)), inc\_count: format(datum.inc, ',')}"  
}  
},  
"hover": {  
"fill": {  
"value": "firebrick"  
}  
}  
}  
}  
],  
"config": {  
"range": {  
"category": {  
"scheme": "elastic"  
}  
},  
"arc": {  
"fill": "#54B399"  
},  
"area": {  
"fill": "#54B399"  
},  
"line": {  
"stroke": "#54B399"  
},  
"path": {  
"stroke": "#54B399"  
},  
"rect": {  
"fill": "#54B399"  
},  
"rule": {  
"stroke": "#54B399"  
},  
"shape": {  
"stroke": "#54B399"  
},  
"symbol": {  
"fill": "#54B399"  
},  
"trail": {  
"fill": "#54B399"  
},  
"title": {  
"color": "#343741"  
},  
"style": {  
"guide-label": {  
"fill": "#69707d"  
},  
"guide-title": {  
"fill": "#343741"  
},  
"group-title": {  
"fill": "#343741"  
},  
"group-subtitle": {  
"fill": "#343741"  
}  
},  
"axis": {  
"tickColor": "#eef0f3",  
"domainColor": "#eef0f3",  
"gridColor": "#eef0f3"  
},  
"background": "transparent"  
}  
}  
Any suggestion will be welcome ..  
Thanks in advance.  
 ![kibana1](https://us1.discourse-cdn.com/elastic/original/3X/7/c/7c44d79313f2b3e17fff0b611f9f10849357c404.png) ![kibana2](https://us1.discourse-cdn.com/elastic/original/3X/3/1/31bebadcfa16f403a6702c121bec7085dc0cdc14.png)

---

<div class="post-metadata">

**Author:** ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)\
**Post date:** [February 4, 2021, 12:03am UTC](https://discuss.elastic.co/t/x-axis-is-not-visible-in-vega-kibana-while-calling-through-index/263088/2 "2021-02-04T00:03:28Z")

</div>

This sounds like a question about vega, vs a question about Kibana. Or does this vega work outside Kibana, but not in Kibana?

If it's just a question about vega, you're likely to get more help faster in some kind of vega-specific forum. Sorry, don't have one to recommend ...

---

<div class="post-metadata">

**Author:** ![saumya1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saumya1/32/87139_2.png) [@saumya1](https://discuss.elastic.co/u/saumya1)\
**Post date:** [February 8, 2021, 4:59am UTC](https://discuss.elastic.co/t/x-axis-is-not-visible-in-vega-kibana-while-calling-through-index/263088/3 "2021-02-08T04:59:47Z")

</div>

X-axis is not getting populated  
{  
"$schema": "[https://vega.github.io/schema/vega/v5.json](https://vega.github.io/schema/vega/v5.json)",  
"description": "A basic bar chart example, with value labels shown upon mouse hover.",

```
"signals": [

{
  "name": "timeunit", "value": ["day"],
  "bind": {"input": "select", "options": [
   ["month"], ["date"], ["day"], ["hours"]
  ]}
}

```

],  
"data": [  
{  
"name": "flights",  
url: {  
index: samptuint  
body: {  
%context%:"true",  
%timestamp%:"@date",  
\_source: ["@date", "ticket", "priority", "inc\_num", "status"]

```
  } 
    }
    format: { property: "hits.hits" }
  "transform": [
    {
      
      "type": "timeunit",
      "field": "date",
      "units": {"signal": "timeunit"},
      "signal": "tbin"
    }
  ]
}

```

],  
"scales": [  
{  
"name": "xscale",  
"type": "band",  
"range": "width",  
"padding": 0.05,  
"round": true,  
"domain": {data:"flights", "signal": "timeSequence(tbin.unit, tbin.start, tbin.stop)"}  
}  
],  
"axes": [  
{ "orient": "bottom", "scale": "xscale",  
"formatType": "time", "format": {"signal": "timeUnitSpecifier(tbin.units, {hours: '%H'})"} }  
]  
}

---

<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 8, 2021, 5:00am UTC](https://discuss.elastic.co/t/x-axis-is-not-visible-in-vega-kibana-while-calling-through-index/263088/4 "2021-03-08T05:00:25Z")

</div>

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