4

I am using jQuery sparklines to display a bar chart, e.g.:

<p><span class="inlinebar">11,13,14,15,13,12,15,11,10,13</span></p>

The problem is that jQuery is using the lowest value, i.e. 10, as a reference and is only displaying a very small bar for it (as if it was 0), while the other bars differ significantly in size (although the values are almost equal).

What I am looking for is an option that tells jQuery to use 0 as a reference, i.e., automatically zero-center the bars. The option

zeroAxis: true

is not doing the trick.

A workaround would be to add a 0 manually to each bar chart, i.e.:

<p><span class="inlinebar">0,11,13,14,15,13,12,15,11,10,13</span></p>

But maybe there is a more elegant way. Any help is appreciated! Thank you very much!

Felix

Felix
  • 41
  • 1
  • 2
  • Could you link us or post the code that doesn't work on jsfiddle.net? Would be easier for everyone that way. – Dogbert Jan 16 '11 at 10:34

1 Answers1

7

In case you haven't found an answer yet: you can use "chartRangeMin: 0" to do what you want, see http://www.omnipotent.net/jquery.sparkline/#common

jbbarth
  • 712
  • 6
  • 6