Highlight a date range in time series chart

Yoav Chen shared this question 3 years ago
Answered

Hi,


Is there a way to highlight a date range in a time series chart?

I have a date range that expands to the past and future and i want to mark the past days (less than today).


I can do conditional formatting on the table but it doesn't help the chart because the chart is showing a metric and not date.

Comments (5)

photo
1

Hi Yoav,


Thanks for getting in touch. Can you show me a screenshot of where you are at and what you are trying to do?


Regards,

Nathan

photo
1

Hi Nathan,

Attached image 1 is showing a time series with dates before today and also future days.

I would like some indication of "Today", so it would be easy to distinguish between past and future (image 2).


Thanks,


Yoav

photo
1

Hi Yoav,

Unfortunately this is not currently possible with conditional formatting, but going along with your screenshot, If you know the maximum range of your Y axis, you can:


  1. Create a pre-defined "Days Between" calculated field that returns the days between now, and your date field.
  2. Create a calculated field with the statement:


  1. CASE WHEN "days between" = 0 THEN (your max y value) END

So there will be one data point for today, and null for the rest of the series.

You can then place this field as a metric onto your bar chart, which will result in something like this:

550aecf7bbb44dd4fed509f5bb10d9d1

Please let me know your thoughts on this.

Regards,

Nathan

photo
1

Hi Yoav,


Any luck in resolving this?


Regards,

Nathan

photo
1

Hi Yoav,


I am going to set this ticket to closed for now, but if there is anything else I can do to help here, please just let me know and the case will be re-opened!


Regards,

Nathan