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

feat(SVG): support for viewport in SVG only providing width and height #1403

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

evangelion1204
Copy link

@evangelion1204 evangelion1204 commented Mar 2, 2023

For now a draft but this should outline what should be achieved. The charts scale without redrawing and rearranging. The drawback might be that fonts can get too small if no responsive options are used.

I do believe we could also smartly skip redraw in such cases until we hit a breakpoint.

Closes #1402

@gionkunz
Copy link
Collaborator

Hey, thanks for your contribution! I guess this would also be relevant for the other chart types, right? https://github.com/chartist-js/chartist/blob/main/src/charts/BarChart/BarChart.ts#L215-L221

@evangelion1204
Copy link
Author

evangelion1204 commented Mar 23, 2023

Sure, I just use a fork right now and needed it for Line-Charts although I also have Bar-Chats in use. I am going to add it here too. I will update the PR within the next days.

@evangelion1204
Copy link
Author

@gionkunz the example I added it to is not too great though. Only thing missing are unit tests around the createSvg function.

@evangelion1204
Copy link
Author

Ok, updated the tests.

@evangelion1204
Copy link
Author

@gionkunz In case you got some time please review. I would also like to create more PRs later on.

@evangelion1204
Copy link
Author

@gionkunz Quick reminder 😄

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.

Support for viewBox for scalable and responsive charts
2 participants