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

[BUG] Sparkline issue when series max and min are the same #27

Open
FrancisMurilloDigix opened this issue Sep 30, 2020 · 0 comments
Open

Comments

@FrancisMurilloDigix
Copy link

Hi.

Thanks for this library, was able to create a small monitoring tool for my requirement. Just want to report on a possible bug where a Sparkline series has the same min and max value possibly causing an arithmetic error. The snippet below has this error:

panel title: "LINES:" do
  sparkline(series: [1])     # Error
  sparkline(series: [1,1])  # Error
  sparkline(series: [1,2])  # Works
end

I noticed in Ratatouille.Renderer.Element.Sparkline.normalize has this possibility:

defp normalize({min, max}, value) do
  x = (value - min) / (max - min)
  round(x * @range)
end

Not sure if this is intended or is better handled by another component. Thanks again.

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

1 participant