[FEATURE] Add horizontal crosshair option to TimeSeriesChart plugin - #809
Open
oschrenk wants to merge 1 commit into
Open
[FEATURE] Add horizontal crosshair option to TimeSeriesChart plugin#809oschrenk wants to merge 1 commit into
oschrenk wants to merge 1 commit into
Conversation
Add an optional tooltip.axisPointer spec field, mirroring the ECharts naming and nesting. With type "cross", hovering a panel shows a horizontal line at the cursor's y position. Closes perses/perses#4434 Signed-off-by: Oliver Schrenk <oliver.schrenk@gmail.com>
oschrenk
commented
Sep 10, 2026
Comment on lines
+495
to
497
| setIsHovered(false); | ||
| if (tooltipPinnedCoords === null) { | ||
| setShowTooltip(false); |
Author
There was a problem hiding this comment.
As mentioned in the description. I distinguish hovered and showing tooltips because, tooltips might be pinned, but i might not hover anymore.
Please advice if that distinction make sense to you.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes perses/perses#4434.
Adds an optional
axisPointersetting to the TimeSeriesChart tooltip spec to control the axis pointer of the ECharts tooltip. Specifically the single option to add a horizontal line.With
type: "cross", hovering a panel now shows a horizontal line at the cursor's y position in addition to the default vertical line. Useful for visually comparing series levels within a panel.It adds a spec field (no UI editing as of now) mirroring the ECharts naming and nesting.
Choices:
connectforwards the y pointer by value (axisTrigger.ts#L407-L411), so other panels would show a line at the same y value mapped into their own scale, which means nothing across different units. This is the most controversial change and I introducedisHoveredto distinguish a panel being hovered from the tooltip being shown (which can stay pinned). Open to other solutions here.crossonly. While ECharts also allowsline,shadowandnone, onlycrossis accepted for now. Not sure if there is value in adding the other options, but it leaves room for it.label.showto true forcross(modelHelper.ts#L266-L269). I disabled it since the custom tooltip from Perses clashes with that idea.crossdoes not apply there.Testing
timeserieschart/v0.13.0for host compatibilityScreenshots
Checklist
[<catalog_entry>] <commit message>naming convention.