Documentation

There is two type of data array for jqBarGraph. First is for simple bar graph type, and second is for multi and stacked bar type.



For simple bar graph type data for one bar should look like this: [value, label, color]. Label and color are optional. This is example for simple bar graph type:



arrayOfData = new Array(

[10.3,'Jan','#f3f3f3'],

[15.2,'Feb','#f4f4f4'],

[13.1,'Mar','#cccccc'],

[16.3,'Apr','#333333'],

[14.5,'May','#666666']

);



For multi and stacked type of graph you should send data in next format: [[value1, value2, value3, ..., valueN], label]. It should look similar to this:



arrayOfData = new Array(

[[14,54,26],'2007'],

[[8,48,38],'2008'],

[[4,36,57],'2009']

);



After you set your data array you just need to say in which div you want graph to be created. All you have to do is:



$('#divForGraph').jqBarGraph({ data: arrayOfData });



The code above is enough to display your data as bar graph. But if you want to made your graph prettier you can achieve that with next set of parameters:



data: arrayOfData,

title: false,

barSpace: 10,

width: 400,

height: 200,

color: '#000000',

colors: false,

lbl: '',

sort: false,

position: 'bottom',

prefix: '',

postfix: '',

animate: true,

speed: 2,

legendWidth: 100,

legend: false,

legends: false,

type: false,

showValues: true,

showValuesColor: '#fff'