Conversation
ECharts containLabel does not cover right axes with offset>0, so the outermost axis tick labels were clipped. Return rightGridPadding from layout helper and always accumulate per-axis label widths. Signed-off-by: colivi <charles.olivi@gmail.com>
Signed-off-by: colivi <charles.olivi@gmail.com>
Signed-off-by: colivi <charles.olivi@gmail.com>
Signed-off-by: colivi <charles.olivi@gmail.com>
3 tasks done
shahrokni
reviewed
Sep 28, 2026
Comment on lines
+33
to
+36
| const fallback = Math.max(formattedLabel.length * CHAR_WIDTH_BASE, 28); | ||
| if (typeof document === 'undefined') { | ||
| return fallback; | ||
| } |
Contributor
There was a problem hiding this comment.
- 28 is a Magic number, it should be replaced with a descriptive const variable. Why 28 is the appropriate value?
- fallback is a vague name. It should be replaced with
fallbackLabelWidth
| additionalFormats.forEach((format, index) => { | ||
| const rightAxisConfig: YAXisComponentOption = { | ||
| const labelWidth = estimateLabelWidth(format, maxValues?.[index] ?? 1000) + AXIS_LABEL_PADDING; | ||
| axes.push({ |
Contributor
There was a problem hiding this comment.
Avoid using magic number.
Comment on lines
+117
to
+118
| axes, | ||
| rightGridPadding: cumulativeOffset > 0 ? cumulativeOffset : 20, |
Contributor
There was a problem hiding this comment.
Avoid using magic number.
Contributor
|
@colivi this changes the UI, please attach screenshots of the before and after |
Rename fallback width and extract MIN_AXIS_LABEL_WIDTH, DEFAULT_AXIS_MAX_VALUE, and DEFAULT_RIGHT_GRID_PADDING. Signed-off-by: colivi <charles.olivi@gmail.com>
Contributor
Contributor
Author
|
Hello,
|
MIN_AXIS_LABEL_WIDTH is four average characters, which answers the review note on the previous literal 28. 1000 and 20 stay named DEFAULT_AXIS_MAX_VALUE and DEFAULT_RIGHT_GRID_PADDING. Signed-off-by: colivi <charles.olivi@gmail.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.


Description
Right-side multi-Y axes with "offset > 0" sit outside ECharts "containLabel", so the outermost axis tick labels were clipped (including fullscreen).
Changes
Follow-up
timeserieschart should set "grid.right" from this padding (see companion plugins PR perses/plugins#837).
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.