-
Notifications
You must be signed in to change notification settings - Fork 5
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
Incorrect plot #2
Comments
Hi! It has very limited accuracy when few points are given. It is also very dumb. In fact it renders a histogram, not really a chart. Because your data has three points, it decides to draw only three bars (of the same size). Then it averages values within each bar's range, which results in a pretty inaccurate chart. I tried adding an options to manually specify the number of buckets (#3), but the results are still not ideal. console.log(babar([ [ 0, 0 ],
[ 796.6869999170303, 93.34886665361937 ],
[ 2985.1589999198914, 99.99999999999999 ] ], {
buckets: 8,
color: 'ascii'
}))
To be honest this script was hacked together a long time ago, to get accurate results I would have to rewrite it properly (which I might do if I ever find the time). But to address this case I think it would have to be a chart renderer, not a histogram renderer. |
By the way I've done my share of SVG chart rendering in the past years, so maybe I'll find the motivation to create a better renderer :) |
@paulirish not really a fix, more a work around, I add value for each 50 ms till the next rounded second
First with prettyfier, second without, this allows to catch more steps
|
Hiya. I love babar, but found a problem with it..
generates
whereas it really looks like
The text was updated successfully, but these errors were encountered: