Hello!
I have weekly Sunday reports and would like to visulize them
I've noticed that when selecting a weekly time interval in any time diagram in Kibana Lens, every bucket displays the first day of the week interval.
For instance, if I am visualing the interval from January 29, 2024 (Monday) to February 4, 2024 (Sunday), it shows 2024-01-29 while hovering a mouse on the bar.
I'm wondering if there's a way to change this behavior. I'd prefer it to display the latest day in the weekly interval, such as 2024-02-04.
Could you please let me know if there's a way to adjust this?
Thank you!
Steps to reproduce:
-
Create a mapping and dummy docs via Dev Tools representing the case "I have weekly Sunday reports":
PUT weekly_index { "mappings": { "properties": { "@timestamp": { "type": "date" }, "value": { "type": "double" } }, "runtime": { "day_of_week": { "type": "keyword", "script": { "source": "emit(doc['@timestamp'].value.getDayOfWeekEnum().toString())" } } } } } POST weekly_index/_doc { "@timestamp": "2024-02-04", "value": "4" } POST weekly_index/_doc { "@timestamp": "2024-02-11", "value": "11" } POST weekly_index/_doc { "@timestamp": "2024-02-18", "value": "18" } POST weekly_index/_doc { "@timestamp": "2024-02-25", "value": "25" }
-
Create a data view called
weekly_index
-
Create a Lens visualization in Kibana:
- Set the time interval to the last 2 months
- Select
weekly_index
data view - Select
Bar vertical
diagram - Drag and drop
@timestamp
field underHorizontal axes
and set itsMinimal interval
toDay
- Drag and drop
value
field underVertical axes
: theMedian
standard formula should automatically applied - Drag and drop
day_of_week
field underBreakdown
Here, you have to receive this visulization:
-
When hovering over a bar, it displays the Sunday date for every bucket, e.g.:
-
Change
@timestamp
field'sMinimal interval
toWeek
-
Now when hovering over a bar, it displays the Monday date for every bucket, e.g.:
-
I would like it to display the Sunday date again for every bucket, e.g.: