# Scatter Plot in Kibana Dashboard

**URL:** <https://discuss.elastic.co/t/scatter-plot-in-kibana-dashboard/353897>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [February 22, 2024, 3:12pm UTC](https://discuss.elastic.co/t/scatter-plot-in-kibana-dashboard/353897 "2024-02-22T15:12:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertomzc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robertomzc/32/132010_2.png) [@robertomzc](https://discuss.elastic.co/u/robertomzc)\
**Post date:** [February 22, 2024, 3:12pm UTC](https://discuss.elastic.co/t/scatter-plot-in-kibana-dashboard/353897/1 "2024-02-22T15:12:50Z")

</div>

Hi all,

We have created a dashboard with several plots regarding the status and parameters of a bunch of batteries during their use, charge and discharge.  
Among other we have the classic lenses line and pie plots, for which the upper bar filters work marvelous.

However, there is some info for which the best plot is a simple scatter plot X-Y with some legend for each serial number of the battery for example. We have created this with Vega-Lite and it works okay but it is a pitty that the upper bar filters do not work with them. We end up having to change the vega code if we want to filter a particular period of time or battery serial number of each of the plots.

The question will therefore be: is there a way that the upper bar filters are taken into account in vega-lite plots? Or otherwise, is it possible to do some scatter plots with Lens?

Thank you very much,  
Rober

---

<div class="post-metadata">

**Author:** ![drewdaemon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewdaemon/32/97779_2.png) [@drewdaemon](https://discuss.elastic.co/u/drewdaemon)\
**Post date:** [February 22, 2024, 3:42pm UTC](https://discuss.elastic.co/t/scatter-plot-in-kibana-dashboard/353897/2 "2024-02-22T15:42:32Z")

</div>

Hi there! You can wire up your Vega vis to the time range by including `%timefield%: mytimefieldname` at the top level of your "url" configuration.

`%context%: true` will also bring in any filters defined on the dashboard.

Example

```auto
  data: {
    url: {
      %context%: true
      %timefield%: order_date
      index: kibana_sample_data_ecommerce
      body: {
        aggs: {
          categories: {

```

This is all from our [tutorial](https://www.elastic.co/guide/en/kibana/current/vega.html#vega-tutorial-create-a-stacked-area-chart).

Does that help?

---

<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 21, 2024, 3:42pm UTC](https://discuss.elastic.co/t/scatter-plot-in-kibana-dashboard/353897/3 "2024-03-21T15:42:55Z")

</div>

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