Skip to content

fix: keep chart tooltips within visible bounds - #486

Open
RomuloGatto wants to merge 3 commits into
monoscope-tech:masterfrom
RomuloGatto:fix/chart-tooltip-viewport
Open

fix: keep chart tooltips within visible bounds#486
RomuloGatto wants to merge 3 commits into
monoscope-tech:masterfrom
RomuloGatto:fix/chart-tooltip-viewport

Conversation

@RomuloGatto

@RomuloGatto RomuloGatto commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • render HTML chart tooltips inside the chart and enable ECharts confinement
  • cap tall multi-series tooltips to the chart height and make their contents scrollable
  • add regression coverage for the shared dashboard tooltip options

Why

Axis tooltips with many series can be taller than the viewport. With appendToBody: true and no confinement, ECharts positions the tooltip above the hovered point, leaving the beginning of the tooltip outside the visible area.

Keeping the tooltip in the chart, constraining its border box, and enabling internal scrolling keeps every series accessible without covering page chrome.

Validation

  • focused Haskell regression: 2 examples, 0 failures
  • web-components: 15 files and 268 tests passed
  • Vite production build passed
  • Fourmolu 0.19.0.0 check and HLint passed
  • synthetic ECharts browser fixture with 80 series:
    • before: 1,956px tooltip at top -1,712px, outside the viewport
    • after: 304px tooltip within the 24-348px chart bounds, with all 1,954px of content available by scrolling

Test-suite note

The complete unit binary currently has 49 pre-existing parser/template failures on upstream master. This change reduces the tooltip regression from two failures to zero; the focused tooltip tests pass and no tooltip failure remains in the full run.

Closes #487

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: chart tooltips can render outside the visible area

1 participant