fix(dashboards): Prevent threshold lines from overlapping the chart legend#109488
Merged
DominikB2014 merged 1 commit intomasterfrom Feb 26, 2026
Conversation
…egend Threshold mark lines and areas use pixel coordinates (y: maxOffset) when their value is Infinity, since ECharts can't render at y=Infinity. The previous hardcoded maxOffset of 5px placed these elements near the top of the SVG container, which falls inside the legend area (which occupies the first ~25px when visible). Fix by passing the grid top offset from TimeSeriesWidgetVisualization into Thresholds.toSeries() as maxOffset, matching the existing maxOffset class property name. This ensures infinite-value threshold lines/areas are positioned at the top edge of the chart grid rather than the SVG container. Co-Authored-By: Claude <noreply@anthropic.com>
narsaynorath
approved these changes
Feb 26, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes bug where thresholds overlapped with legend

before
after

Threshold mark lines and areas use pixel coordinates (
y: maxOffset) when their value isInfinity, since ECharts can't render aty=Infinity. The previous hardcodedmaxOffsetof5pxplaced these elements near the top of the SVG container — which falls inside the legend area when a legend is visible (the legend occupies roughly the first 25px).The fix passes the computed grid top offset from
TimeSeriesWidgetVisualizationintoThresholds.toSeries()asmaxOffset. This matches the existingmaxOffsetclass property name and ensures infinite-value threshold lines/areas are always positioned at the top edge of the chart grid rather than the SVG container.Fixes DAIN-1239