Repository navigation
feat: add xyChart.rightAxis for a second value axis - #19
Merged
Merged
Conversation
snario
force-pushed
the
feat/xychart-right-axis
branch
from
November 9, 2026 23:18
a0bd07a to
f107ee7
Compare
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.
Builds on #18 and includes its commit. The new commit is the last one.
Some charts put two quantities with different units or magnitudes on one chart, such as revenue and margin. On one value axis, the smaller series flattens near zero.
This adds a
rightAxisoption underxyChart. Series named inrightAxis.seriesare measured against a second value axis:minandmaxset the range. Without them, the axis fits its series, and bars stand on zero.titlesets the axis title.showTitle,showLabel,showTick, andshowAxisLinework as on the other axes.stacked: true, bars of each axis form their own stack, and the two stacks stand side by side.The option is configuration only, so the parser and diagram model stay identical to Mermaid 12.1.0, which ignores the key.
--- config: xyChart: rightAxis: series: [Margin] title: "Margin (%)" min: 0 max: 50 --- xychart x-axis [Q1, Q2, Q3, Q4] y-axis "Revenue ($M)" bar "Revenue" [120, 180, 240, 310] line "Margin" [12, 18, 22, 29]Validation:
cargo clippy,cargo test --workspace,pnpm check,pnpm check:types,vp test --project node(806 tests) andpnpm check:sizepass. Every existing XY chart vector renders byte-identical SVG. The browser screenshot suite was not run.