Repository navigation
fix(ui/chart): pin the left axis panel width - #26
Merged
Merged
Conversation
ScottPlot sized the left axis panel to its widest tick label, so the data area moved by about 15 px whenever the scale changed, for example between 100 and 15 000 when the trend switched normalization. Both charts now pin the panel to one width through MinimumSize and MaximumSize, as SemiPlot pins its axis panels, so the data area never moves and the spectrum and trend data areas line up. The 112 px width is measured: the widest tick, 65 535,25, beside the trend's two-line normalized Y label needs 107.7 px, and a text-fit test holds it. The spectrum chart floor in the tests grows from 400 to 440 px to keep four wavelength ticks; the window's minimum width does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
ScottPlot sized the left axis panel to its widest tick label. The data area therefore moved by about 15 px whenever the scale changed, for example between "100" and "15 000" when the trend switched normalization. The spectrum and trend data areas also started at different x.
Change
ChartAxisRegion.LeftPanelWidth= 112 px.ChartAxisRegion.PinLeftPanelsets the left axisMinimumSizeandMaximumSizeto it on both charts, as SemiPlot'sChartAxisBinder.AxisPanelWidthdoes.TheWidestTickAndYLabelFitThePinnedLeftPanelOfBothChartslifts the pin, measures ScottPlot's own panel size for those labels, and fails if they outgrow 112 px.overview.mdgets a "The left axis panel" section and the updated data-area widths: 817 px for the spectrum and 1129 px for the trend at the minimum width.Verification
dotnet build -c Release: 0 warnings.dotnet test: 1135 passed.dotnet format --verify-no-changesandterseon the changed files: exit 0.Per-task commits before collapse
🤖 Generated with Claude Code