You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, thank you for providing this library, it's a really handy tool.
In SparklineFont.DrawSparkline you search the input data for min and max, however, if the data only contains zeros, max is set to zero and therefore pcy0 and pcy1 are set to NaN due to a divide by zero issue.
For example, the input data "0.0,0.0,0.0" results in the GeneratedText being as per sample below and not rendering correctly in the browser.
Hello,
Firstly, thank you for providing this library, it's a really handy tool.
In
SparklineFont.DrawSparkline
you search the input data for min and max, however, if the data only contains zeros, max is set to zero and thereforepcy0
andpcy1
are set to NaN due to a divide by zero issue.For example, the input data
"0.0,0.0,0.0"
results in theGeneratedText
being as per sample below and not rendering correctly in the browser.I'd have a go at creating a PR, but not sure how you'd want it fixed. Any chance you could take a look please?
The text was updated successfully, but these errors were encountered: