18

Apologies, but I'm a newbie at Flot.

I'd like to display my data in a horizontal bar chart rather a vertical bar chart which Flot seems to default to.

Is it possible to do this in Flot, and, if so, how do I do it?

HMartch
  • 728
  • 3
  • 12
ssi_bas
  • 215
  • 2
  • 3
  • 5

2 Answers2

27
bars: {
      horizontal: true
    }

API reference: http://flot.googlecode.com/svn/trunk/API.txt

iivel
  • 2,576
  • 22
  • 19
  • oops. oh yeah. protovis is still worth checking out – Spacedman Feb 28 '11 at 21:09
  • I'll take a look, but we're pretty in bed with flot here. A lot of sparkline style charts and multiaxis JSON driven charts. Would take forever to change. Doesn't seem to work in IE7 though? – iivel Feb 28 '11 at 21:15
  • Thanks for your responses. I tried this and yes, it works. The only problem though is that I have to change the x and y-axes data. – ssi_bas Mar 09 '11 at 23:45
2

For an example of a horizontal bar chart built with Flot, check out http://www.jqueryflottutorial.com/how-to-make-jquery-flot-horizontal-bar-chart.html

JONATHAN SEDER
  • 376
  • 1
  • 4