-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show bucket size for Time Series Visual Builder on X-Axis #11639
Show bucket size for Time Series Visual Builder on X-Axis #11639
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really nice addition, it really improves comprehension, I agree.
LGTM, but I'd also consider removing some of the duplication in computing the units.
y: 'years' | ||
}; | ||
export function getAxisLabelString(interval) { | ||
const units = _.pluck(_.clone(relativeOptions).reverse(), 'value') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some duplication of this. units
is a global constant, and we also use it in parse_relative_parts.js
.
I would extract the units-array
and the unitLookup
-map to a different module, and pull it in where needed. E.g. add the units-array and the lookup table to the time_units
module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The painful part of trying to use time_units.js
is that it's setting a constant for Angular and the code that uses this is in React.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough
* Adding seconds to the timeseries tooltip * Adding x-axis label to show the bucket size
Backported to 5.x with 98de700 |
This PR add an x-axis label to the Time Series visualization for the Time Series Visual Builder that displays the interval size. For something with 10000 milliseconds it will display 'per 10 seconds'. This also changes the date format of the tooltip to display seconds.
Before:
After: