I'm trying to set up a horizontal bar graph using jqplot as follows:
var plot1 = $.jqplot('graph', [gData], {
seriesDefaults: {
renderer:$.jqplot.BarRenderer,
rendererOptions: {
barDirection: 'horizontal'
}
},
axes: {
yaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: gTicks
}
}
});
This code works fine with vertical bars, like:
var plot1 = $.jqplot('graph', [gData], {
seriesDefaults: {
renderer:$.jqplot.BarRenderer
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: gTicks
}
}
});
But when I go to make it horizontal, suddenly the bars no longer line up with the ticks. For example, for some ticks, there may be two or more overlapping bars. And for some, there may be none at all. Finally, there is an additional 'undefined' tick that seems to have tons of bars overlapping.
gData and gTicks are both javascript arrays.
Any thoughts?
EDIT: The undefined category is actually my own creation, but the problem remains unchanged.