feat: Adjust dates display on the graph x-axis #25123
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Fix for #2656.
The logic explained:
For example, hourly graph will not show the date unless it is a new day, daily graph will not show the year in the date unless it is a new year and so on. The screenshots below better illustrate this.
Changes
How did you test this code?
I have only manually tested this. I am having trouble running the visual tests.
Concerns
Regarding point 2, I am not able to assuredly decide which component needs to have this function. I am also not sure if this should go inside a Kea function handler.
To be more precise, this is the tree hierarchy according to my investigations. Currently the change is at a LineGraph level. But should the changes to the labels be higher up the tree? Should it be in the Python code? Should it be in the HogQL query? I have attached these files to the PR for discussion and will remove them once the decision is made.