Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aspect-ratio #112

Open
wants to merge 5 commits into
base: live
Choose a base branch
from
Open

aspect-ratio #112

wants to merge 5 commits into from

Conversation

eatyourpeas
Copy link
Member

Overview

@dmc-cambric and colleagues from Cambric in Scotland need the chart to be wider in landscape the the currently hard-coded width of 1000px

This PR reintroduces height and width optional props to the RCPCHChart component. If not supplied, the chart defaults to 1000px width, 800px height. NOTE: both height and weight must be supplied and the user must work out a sensible aspect ratio themselves. Because the SVG chart will scale to the width and height supplied, but the text (and datapoints) within it will not, the height and weight are used to calculate a scale factor for text to be applied to tooltips and axis labels and the event and legend text. This scaling does not apply to titles, buttons or plotted datapoints.

A further raised issue relates to the use of createGlobalStyles which has had the effect of applying RCPCHChart styles across the DOM. Apologies for this. This has been fixed by using a simpler styled div to wrap the <CentileChart/> and <SDSChart/> components.

Code changes

Please describe the changes you made here.

Documentation changes (done or required as a result of this PR)

The documentation in the mdx story file has been updated with the changes.

Related Issues

This closes #101 and #110

Mentions

Thanks to @dmc-cambric

@eatyourpeas eatyourpeas added the ui issues relating to user interface label Oct 17, 2024
@eatyourpeas eatyourpeas self-assigned this Oct 17, 2024
@eatyourpeas eatyourpeas linked an issue Oct 17, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui issues relating to user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RCPCH Chart - SVG scaling maxes out at 1000w x 800h - v7.0.12 aspect ratio
1 participant