Open katowulf opened 11 years ago
Fwiw, I'd be happy to submit a fix for this if someone wants to give me a jumpstart by suggesting a likely offender.
Not sure I understand what you expect to be displayed - In your example all your columns except the last have values that add up to 5, so they're all even.. The last adds up to 9 - Why would you not expect the final column to be larger than the others?
It's not that the last column is taller. Have a closer look at the images and the description: When one column is taller, the sum 5 columns are no longer the same height--they are off by a pixel or two.
ah ok.. yep, that's a bug with the rounding off of the bar heights
I took a stab at this which seemed to solve the problem (as well as issues 99 and 98).
Here's the change: https://github.com/mcmanuss8/jquery.sparkline/commit/ea51eb0b041adeb78352ff7612981906310b9663#diff-25d902c24283ab8cfbac54dfa101ad31
A fiddle using the 2.1.2 release: http://jsfiddle.net/katowulf/Yk6WJ/
If they add to the same total, my bars look great:
But if I add a bar that exceeds the total, they render off by a pixel, giving the chart a bit of an erratic look (it's even more uneven when the bars are very small):