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.
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