Skip to content

fix(dashboards): Prevent threshold lines from overlapping the chart legend#109488

Merged
DominikB2014 merged 1 commit intomasterfrom
dominikbuszowiecki/dain-1239-threshold-line-intersects-with-legend-in-widget-chart
Feb 26, 2026
Merged

fix(dashboards): Prevent threshold lines from overlapping the chart legend#109488
DominikB2014 merged 1 commit intomasterfrom
dominikbuszowiecki/dain-1239-threshold-line-intersects-with-legend-in-widget-chart

Conversation

@DominikB2014
Copy link
Contributor

@DominikB2014 DominikB2014 commented Feb 26, 2026

Fixes bug where thresholds overlapped with legend
before
image

after
image

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 when a legend is visible (the legend occupies roughly the first 25px).

The fix passes the computed grid top offset from TimeSeriesWidgetVisualization into Thresholds.toSeries() as maxOffset. This matches the existing maxOffset class 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

…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>
@linear
Copy link

linear bot commented Feb 26, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 26, 2026
@DominikB2014 DominikB2014 marked this pull request as ready for review February 26, 2026 15:17
@DominikB2014 DominikB2014 requested a review from a team as a code owner February 26, 2026 15:17
@DominikB2014 DominikB2014 enabled auto-merge (squash) February 26, 2026 15:22
@DominikB2014 DominikB2014 merged commit 1d15be3 into master Feb 26, 2026
60 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/dain-1239-threshold-line-intersects-with-legend-in-widget-chart branch February 26, 2026 15:23
@DominikB2014 DominikB2014 restored the dominikbuszowiecki/dain-1239-threshold-line-intersects-with-legend-in-widget-chart branch February 26, 2026 18:12
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants