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

Vertical padding #30

Closed
jaimeiniesta opened this issue Feb 26, 2024 · 4 comments
Closed

Vertical padding #30

jaimeiniesta opened this issue Feb 26, 2024 · 4 comments

Comments

@jaimeiniesta
Copy link

Hi, thanks for sharing this awesome library!

Is there a way to use only vertical padding?

When using smoothing (even the default 0.15), the line can be cropped at the top and bottom borders:

Captura de pantalla 2024-02-26 a las 14 46 03

This can be fixed by setting padding, but then I also get horizontal padding, it would be great to have only padding at the top and bottom.

@abdelaz3r
Copy link
Owner

Hi,

Thanks for the comment ;)

It's funny because I actually addressed that just a few hours ago. It's still a work in progress but here is the pr: #29.

These updates are expected to be included in the upcoming v0.3 version.

@jaimeiniesta
Copy link
Author

jaimeiniesta commented Feb 26, 2024

Awesome, thanks! I can confirm that the PR fixes that, here's the above charts with some vertical padding:

Captura de pantalla 2024-02-26 a las 17 08 35

@abdelaz3r
Copy link
Owner

v0.3.0 has been released!

Please note that I made slight changes to the API compared to what you saw in the pull request.

# Both example are for padding top and bottom at 5, and left and right at 0.
# First version:
Sparkline_svg.new(data, padding: {5, 0})

# Current version:
Sparkline_svg.new(data, padding: [top: 5, left: 0, bottom: 5, right: 0])

@jaimeiniesta
Copy link
Author

Thanks! Just upgraded and everything looks smooth. I like the new syntax, much clearer 👍

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

No branches or pull requests

2 participants