feat: add dual y-axis support to CartesianChart#182
Open
abenitesDC wants to merge 3 commits intocloudscape-design:mainfrom
Open
feat: add dual y-axis support to CartesianChart#182abenitesDC wants to merge 3 commits intocloudscape-design:mainfrom
abenitesDC wants to merge 3 commits intocloudscape-design:mainfrom
Conversation
pan-kot
reviewed
Mar 9, 2026
|
We wanted something like this! Thanks for implementing it. |
pan-kot
reviewed
Mar 19, 2026
pan-kot
reviewed
Mar 19, 2026
pan-kot
reviewed
Mar 19, 2026
pan-kot
reviewed
Mar 19, 2026
95b98d6 to
5d96606
Compare
Allow CartesianChart to render two Y axes by passing a tuple to the yAxis prop. The second axis is automatically set to opposite (right side). Series can reference the secondary axis with yAxis: 1. Changes: - Add yAxis?: number to BaseCartesianSeriesOptions - Accept yAxis as single or [primary, secondary] tuple in CartesianChartProps - Pass yAxis through all series transform functions - Auto-set opposite: true on the secondary axis - Add unit tests and demo page
5d96606 to
2f90bb6
Compare
gethinwebster
approved these changes
Mar 31, 2026
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
yAxis?: numberto cartesian series types so series can reference which Y axis they belong toyAxisas a single object or[primary, secondary]tuple inCartesianChartPropsopposite: trueon the secondary axis when using the tuple formyAxisthrough all series transform functions (line, column, scatter, threshold, error bar)Test plan
tsc --noEmit)01-cartesian-chart/dual-axis-chart