joewalnes / smoothie

Smoothie Charts: smooooooth JavaScript charts for realtime streaming data
http://smoothiecharts.org
Other
2.25k stars 232 forks source link

Incorrect interpretation of maxValue / minValue when values are negatives #35

Closed glebiller closed 10 years ago

glebiller commented 11 years ago

It seems to have an issue when values are interpreted as Strings and values are negative. The comparison does not work the way it should, and the maxValue / minValue calculation is wrong.

To fix the issue, I have added a "parseFloat(value)" at first line of the method "TimeSeries.append".

I think it should be safer to include it in the code instead of making sure people are sending numeric values. When working with JSON this is not always true :)

drewnoakes commented 10 years ago

Issue #45 duplicated this issue, and provided a patch that has now been merged. I'll close this too. Thanks.