Constrain usage-history charts to their card bounds#200
Merged
Conversation
MudBlazor sets min-height/min-width fit-content on the chart element, which overrode the wrapper height in the flex layout and let the SVG grow past its card into the tile below. Override those minimums to zero, size the SVG via flex, and clip the wrapper so charts stay within their cards on phone, tablet, and desktop.
|
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.



Summary
Fix the usage-history line charts overflowing far below their cards on phone, tablet, and desktop. The chart wrapper CSS now overrides MudBlazor's
fit-contentminimum sizing, sizes the SVG through flex, and clips the wrapper.Why
MudBlazor applies
min-height: fit-content/min-width: fit-contentto themud-chartelement. In the flex layout that minimum overrode the wrapper'sheight: 100%, so the SVG grew to the intrinsic height of its content (axes, labels, legend) and rendered well beyond the card. With no overflow clipping and a semi-transparent card surface (--dug-surface: rgba(…, 0.82)), the overflowing chart bled into and showed through the neighbouring card. The previously addedMatchBoundsToSizedid not reliably resolve the ambiguous sizing.Linked issues
Review notes
Change is limited to
.dug-chartrules inwwwroot/app.css:min-width/min-height: 0on.mud-chartto defeat thefit-contentminimums,flex: 1 1 autoon the SVG so it fills the available space alongside the legend, andoverflow: hiddenon the wrapper as a safeguard against any residual bleed. The fix applies to every breakpoint and to both chart pages (DockerInstances and RuntimeContainerDetail), which share the.dug-chartclass.MatchBoundsToSize="true"is retained and now measures a stable size.Follow-up work
None