Skip to content

Fix/timeseries multi y grid right - #837

Open
colivi wants to merge 12 commits into
perses:mainfrom
colivi:fix/timeseries-multi-y-grid-right
Open

colivi wants to merge 12 commits into
perses:mainfrom
colivi:fix/timeseries-multi-y-grid-right

Conversation

@colivi

@colivi colivi commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

With 2+ right Y-axes, the last axis labels were cut off even when the panel is maximized.
ECharts "containLabel" does not reserve space for right axes that use "offset".

Changes

When multi-Y is active: "grid.right = additionalFormats.length * 52 + 12"

Related

Pairs with shared "getFormattedMultipleYAxesLayout" / "rightGridPadding" (can switch to that API once shared PR perses/shared#321 is released).

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

Right axes with offset are outside ECharts containLabel; reserve ~52px
per additional format so outermost tick labels are not clipped.

Signed-off-by: colivi <charles.olivi@gmail.com>
Signed-off-by: colivi <charles.olivi@gmail.com>
@colivi
colivi requested a review from a team as a code owner September 25, 2026 20:11
@colivi
colivi requested review from jgbernalp and removed request for a team September 25, 2026 20:11
containLabel: false,
};
}
const rightPad = additionalFormats.length > 0 ? additionalFormats.length * 52 + 12 : 20;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do these magic numbers come from? a comment will be helpful here.

@jgbernalp

Copy link
Copy Markdown
Contributor

@colivi please include screenshots of before and after, this will help reviewers to understand the fix better

Named constants for per-axis width and margins until shared
rightGridPadding is available.

Signed-off-by: colivi <charles.olivi@gmail.com>
Use getFormattedMultipleYAxesLayout so the chart margin matches the
cumulative width of the right axes instead of a fixed 52px heuristic.

Signed-off-by: colivi <charles.olivi@gmail.com>
@colivi

colivi commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Hello,
2 pictures, before and after, it requires shared#321 to see after (with getFormattedMultipleYAxesLayout support).

before-narrow after-narrow

colivi added 4 commits October 2, 2026 17:18
The published components package does not export the shared#321 helper
yet, so the panel test mock and a local type declaration provide it.

Signed-off-by: colivi <charles.olivi@gmail.com>
…aration

Signed-off-by: colivi <charles.olivi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants