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

Make cartesian charts responsive #32824

Open
wants to merge 2 commits into
base: usr/atisjai/chartsV9
Choose a base branch
from

Conversation

krkshitij
Copy link
Contributor

@krkshitij krkshitij commented Sep 12, 2024

Previous Behavior

Cartesian charts adjust to the container size only when the width and height props are updated or when the component mounts (e.g., on page load).

New Behavior

With the responsive prop set to true, cartesian charts automatically resize in response to changes in the container size.


/**
* Enables the chart to automatically adjust its size based on the container's dimensions.
* @default false
Copy link
Contributor

Choose a reason for hiding this comment

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

make default to be true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't work well when enableReflow prop is true. The chart gets truncated below min width but scrollbar doesn't appear because svg width is set to 100%.
Will have to disable reflow in all examples. Should I apply this change?

Copy link
Contributor

Choose a reason for hiding this comment

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

do you think this is better than enable reflow solution.

Copy link
Contributor Author

@krkshitij krkshitij Sep 14, 2024

Choose a reason for hiding this comment

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

yes, this solution is better if all the overlapping issues are fixed.

Choose a reason for hiding this comment

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

So, here the bars ( in VBC ) or lines (in LineChart) will get overlapped if we decrease chart size beyond a certain limit ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For bars, we have already fixed the overlapping issue and lines dont have this issue. Currently, only the x-axis tick labels overlap in smaller viewports.

@krkshitij krkshitij marked this pull request as ready for review September 14, 2024 07:00
@krkshitij krkshitij requested a review from a team as a code owner September 14, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants