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

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.

Hi @nyuriks is it something you could advise on?

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 docs):

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

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

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