0
votes

I've searched around and not finding a proper solution/explanation on how to get this right. Essentially what I'm trying to plot would resemble something of the following:

|    #
|#   #
|##  ##
|______
 fb  tw

So essentially two categories, facebook (fb) and twitter (tw). Each category needs two bars for previous month and current month (they are counts). The data is retrieved from server side data.

What I need to know is how to get this chart to work using flot? Fiddle of what I have so far here: http://jsfiddle.net/thorne51/ExUH7/1/

I've tried using the orderBars plugin (as is apparent with the order property in the bars objects) with no success, not that I'm exactly sure what this does. Still very new to flot.

Edit If anyone knows where decent documentation on flot and its plugins exist, or a tutorial, please share :)

1
I've managed to get the bars showing although they are stacked and not aligned very nicely. Any help would be greatly appreciated! jsfiddle.net/thorne51/ExUH7/2thorne51
Pikemere.co.uk has some good examples of basic bar chartsmechenbier

1 Answers

2
votes

You didn't have the Flot Orderbars plugin included in your fiddle. I included it and updated the fiddle: http://jsfiddle.net/ExUH7/4/

I would suggest you think about changing either the x-axis categories or the labels of your data, having them both be 'facebook' and 'twitter' leads to a confusing graph.