# Vega histogram does not work in Kibana

**URL:** <https://discuss.elastic.co/t/vega-histogram-does-not-work-in-kibana/151092>\
**Category:** Kibana\
**Created:** [October 4, 2018, 6:04pm UTC](https://discuss.elastic.co/t/vega-histogram-does-not-work-in-kibana/151092 "2018-10-04T18:04:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vernal](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@vernal](https://discuss.elastic.co/u/vernal)\
**Post date:** [October 4, 2018, 6:04pm UTC](https://discuss.elastic.co/t/vega-histogram-does-not-work-in-kibana/151092/1 "2018-10-04T18:04:38Z")

</div>

I tried to create histogram based on the variable "battery\_temp\_mean", but it shows an error "Cannot read property 'origins' of undefined". If I removed the format line, it shows another error "Cannot read property 'battery\_temp\_mean' of undefined". Could you please tell me what is the problem? Thanks in advance.

{  
"$schema": "[https://vega.github.io/schema/vega-lite/v2.json](https://vega.github.io/schema/vega-lite/v2.json)",  
"title": "Distribution of Mean Voltage",  
"data": {  
"url": {  
"%context%": true,  
"index": "guobiao\_daily\_stats\*",  
"body":{  
\_source:["battery\_temp\_mean"]  
}  
}  
"format": {"property": "aggregations.origins.buckets"}  
},  
"mark": "bar",  
"encoding": {  
"x": {  
"bin": true,  
"field": "\_source.battery\_temp\_mean",  
"type": "quantitative"  
},  
"y": {  
"aggregate": "count",  
"type": "quantitative"  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [October 5, 2018, 2:30pm UTC](https://discuss.elastic.co/t/vega-histogram-does-not-work-in-kibana/151092/2 "2018-10-05T14:30:44Z")

</div>

@vernal,

could you first check if your ES query is actually returning the JSON you expect to see?

I would suggest you try out your ES-query first in the dev-console of Kibana. Once you have it working, bring it over to the Vega-visualization.

---

<div class="post-metadata">

**Author:** ![vernal](https://avatars.discourse-cdn.com/v4/letter/v/b38774/32.png) [@vernal](https://discuss.elastic.co/u/vernal)\
**Post date:** [October 5, 2018, 4:40pm UTC](https://discuss.elastic.co/t/vega-histogram-does-not-work-in-kibana/151092/3 "2018-10-05T16:40:24Z")

</div>

Thanks! How to check if the ES query is actually returning the JSON? What command I should use?

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [October 6, 2018, 6:47pm UTC](https://discuss.elastic.co/t/vega-histogram-does-not-work-in-kibana/151092/4 "2018-10-06T18:47:21Z")

</div>

hi @vernal,

what you'll want to use is the dev-console application in Kibana. It allows you to run your queries against Elasticsearch. For more info, see here [https://www.elastic.co/guide/en/kibana/current/console-kibana.html](https://www.elastic.co/guide/en/kibana/current/console-kibana.html)

Then, after you have your ES-query working, you can paste the body of your query in the `body` property of the Vega-markup.

---

<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 3, 2018, 6:52pm UTC](https://discuss.elastic.co/t/vega-histogram-does-not-work-in-kibana/151092/5 "2018-11-03T18:52:56Z")

</div>

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