Closed gnapse closed 10 years ago
On Aug 14, 2014, at 8:40 AM, Ernesto García notifications@github.com wrote:
I have noticed that bar heights are not proportional to the values they're supposed to represent. For instance, take a look at this screenshot of a quick bar chart I made on the 'try it out' section of your homepage.
The values being represented are 84, 93 and 119. The first value (84) is larger than half the last and largest value (119). So I would expect the first bar to be more than half the height of the last bar.
I have a sense that this is not a bug, but that it works like this by design. If that's the case, I'd like to know what's the logic behind this reasoning. I'd also like to know if there's some configuration option I can pass to achieve the results I'm expecting. I made a quick search on the documentation, and on the issues in this repository, and I've found nothing that could help me on this regard.
— Reply to this email directly or view it on GitHub.
So the solution is to pass the chartRangeMin
option with value zero:
$('#selector').sparkline([84, 93, 119], {
type: 'bar',
chartRangeMin: 0,
});
Thanks!
I have noticed that bar heights are not proportional to the values they're supposed to represent. For instance, take a look at this screenshot of a quick bar chart I made on the 'try it out' section of your homepage.
The values being represented are 84, 93 and 119. The first value (84) is larger than half the last and largest value (119). So I would expect the first bar to be more than half the height of the last bar.
I have a sense that this is not a bug, but that it works like this by design. If that's the case, I'd like to know what's the logic behind this reasoning. I'd also like to know if there's some configuration option I can pass to achieve the results I'm expecting. I made a quick search on the documentation, and on the issues in this repository, and I've found nothing that could help me on this regard.