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

Fixed 0-based values #13

Closed
wants to merge 2 commits into from
Closed

Fixed 0-based values #13

wants to merge 2 commits into from

Conversation

marcfowler
Copy link

I've fixed a bug where it entered NaN's into the path if you provided a list of values that were entirely 0. I ran into this when rendering a line of values like [0, 0, 0, 0, 0]!

Temetra added a commit to Temetra/sparkline that referenced this pull request May 24, 2020
@fnando fnando closed this Sep 10, 2020
glaszig added a commit to glaszig/sparkline that referenced this pull request Dec 3, 2022
calling getY() with 0 value would produce NaN which are invalid in svg where those end up.
in that case, the added condition returns the height in float to draw a data point at y=0.

releated fnando#13, closes fnando#24, fixes fnando#14
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.

None yet

2 participants