# How to get the absolute time of Dashboard time filter picked?

**URL:** https://discuss.elastic.co/t/how-to-get-the-absolute-time-of-dashboard-time-filter-picked/228278
**Category:** Kibana
**Tags:** vega
**Created:** [April 16, 2020, 8:34am UTC](https://discuss.elastic.co/t/how-to-get-the-absolute-time-of-dashboard-time-filter-picked/228278 "2020-04-16T08:34:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![m-amano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m-amano/32/62977_2.png) [@m-amano](https://discuss.elastic.co/u/m-amano)
#### Post date: [April 16, 2020, 8:34am UTC](https://discuss.elastic.co/t/how-to-get-the-absolute-time-of-dashboard-time-filter-picked/228278/1 "2020-04-16T08:34:19Z")

</div>

I want to specify and get the date of absolute calender of 7days selected to title each 7 graphs even though I get no response and a graph has no data. Therefore I want to know which date user picked on Dashboard Time filter.

Or if there is a way to make the x-axis and y-axis invisible when the graph has nothing to show. For example the graph under below has no values, but the x and y axis have been still shown.

 ![example_vegagraph](https://us1.discourse-cdn.com/elastic/original/3X/8/9/892a20ef0e57308063fcb6f2557b93f3cd3c7869.png)

---

<div class="post-metadata">

### Author: ![monfera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monfera/32/26467_2.png) [@monfera](https://discuss.elastic.co/u/monfera)
#### Post date: [April 20, 2020, 3:39pm UTC](https://discuss.elastic.co/t/how-to-get-the-absolute-time-of-dashboard-time-filter-picked/228278/2 "2020-04-20T15:39:13Z")

</div>

Hi @nyuriks is it something you could advise on?

---

<div class="post-metadata">

### Author: ![nyuriks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nyuriks/32/26171_2.png) [@nyuriks](https://discuss.elastic.co/u/nyuriks)
#### Post date: [April 20, 2020, 4:37pm UTC](https://discuss.elastic.co/t/how-to-get-the-absolute-time-of-dashboard-time-filter-picked/228278/3 "2020-04-20T16:37:59Z")

</div>

I'm not sure you can access current time filter values outside of the `data` section, but you could hide the axis. The easiest way would probably be to set all `...Opacity` values to 0 using a signal -- so if there is no data (you can use `data('...')` expression for that, set it to `0`, otherwise set it to `1`. (see [axis](https://vega.github.io/vega/docs/axes/) docs):

```auto
"axes": [
  {
    "orient": "bottom",
    "scale": "x",
    "encode": {
      "domain": {
        "update": {
          "strokeOpacity": {"signal": "length(data('my-data-source')) == 0 ? 0 : 1"}
      },
...

```

---

<div class="post-metadata">

### Author: ![m-amano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m-amano/32/62977_2.png) [@m-amano](https://discuss.elastic.co/u/m-amano)
#### Post date: [April 24, 2020, 4:03am UTC](https://discuss.elastic.co/t/how-to-get-the-absolute-time-of-dashboard-time-filter-picked/228278/4 "2020-04-24T04:03:09Z")

</div>

Hi @nyuriks  
Thank you for your reply. This is very helpful.

---

<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: [May 22, 2020, 4:03am UTC](https://discuss.elastic.co/t/how-to-get-the-absolute-time-of-dashboard-time-filter-picked/228278/5 "2020-05-22T04:03:14Z")

</div>

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