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

How to fit chart to size given #182

Open
Harpush opened this issue Aug 4, 2023 · 1 comment
Open

How to fit chart to size given #182

Harpush opened this issue Aug 4, 2023 · 1 comment
Labels

Comments

@Harpush
Copy link

Harpush commented Aug 4, 2023

When I give the chart width and height I wish for it to fill it all. So even one word would scale to that size. Currently instead I get a much smaller actual size compared to given size. I tried to do it myself with bounds but it seems bounds are incorrect? Any help here?

@jasondavies jasondavies added the req label Aug 7, 2023
@Harpush
Copy link
Author

Harpush commented Aug 7, 2023

@jasondavies so using viewbox I kind of succeeded but it required a lot of work and not 100% accurate.
The idea is setting the size to a larger size than I need (I know performance degrade) and then calculate once done using measure text the actual bounding box. Based on that to align the viewbox to scale into the drawn area.

Out of this I can think of two enhancements:

  1. Auto increase the size internally once a word can't be placed anywhere and try again.
  2. Return actual viewbox ready bounding box (x, y, width, height) or even two x,y pairs as it seems current ones are wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants