# Simpler Vega example?

**URL:** <https://discuss.elastic.co/t/simpler-vega-example/320688>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [December 7, 2022, 1:37pm UTC](https://discuss.elastic.co/t/simpler-vega-example/320688 "2022-12-07T13:37:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tinrik](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tinrik](https://discuss.elastic.co/u/tinrik)\
**Post date:** [December 7, 2022, 1:37pm UTC](https://discuss.elastic.co/t/simpler-vega-example/320688/1 "2022-12-07T13:37:02Z")

</div>

Hi!

I'm new to Kibana and Vega. I'm following this guide:

> **[Learn to build rich Vega Visualizations in Kibana](https://www.elastic.co/blog/getting-started-with-vega-visualizations-in-kibana)**
>
> Vega is a powerful language for creating visualizations, and now you can use it in Kibana. In this blog post, learn to use Vega declarative language to build rich new visualizations from your Elasticsearch data.

So far so good with the "Data-Driven" graph. I have however a lot of trouble to understand and make the jump to the "Dynamic Data with Elasticsearch and Kibana" section. We go from a very simple dataset of 4 documents, to "aggregations", "time buckets", "date\_histogram". Really complicated for a total noob and without any connection to previous content 🙂

Is there any good source that covers the above gap? For example, push the original 4 documents to an index, and instead of hardcoding them in Vega, use Kibana to fetch the data from the index. No aggregations or anything fancy, just display those 4 points.

Thanks!

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [December 7, 2022, 5:40pm UTC](https://discuss.elastic.co/t/simpler-vega-example/320688/2 "2022-12-07T17:40:00Z")

</div>

Hi @tinrik

the Vega integration in Kibana supports aggregations, no direct search queries.  
The idea is to provide the Vega tool to perform data analysis, usually aggregations on the data, querying Elasticsearch.

---

<div class="post-metadata">

**Author:** ![tinrik](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tinrik](https://discuss.elastic.co/u/tinrik)\
**Post date:** [December 8, 2022, 3:35pm UTC](https://discuss.elastic.co/t/simpler-vega-example/320688/3 "2022-12-08T15:35:11Z")

</div>

Thanks for the answer!

I was trying to do something similar to [this thread](https://discuss.elastic.co/t/accessing-elasticsearch-from-vega-to-create-custom-visualizations/200714), where an aggregation is not done - simply the index is queried for data.

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [December 12, 2022, 8:31am UTC](https://discuss.elastic.co/t/simpler-vega-example/320688/4 "2022-12-12T08:31:55Z")

</div>

Hi @tinrik

Actually I was wrong and Vega supports direct searches. Sorry about the confusion.  
That linked thread is correct and it is possible to perform a search: the aggregation has to be done on the client side tho.

---

<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:** [January 9, 2023, 8:32am UTC](https://discuss.elastic.co/t/simpler-vega-example/320688/5 "2023-01-09T08:32:32Z")

</div>

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