这曾经可以正常工作,但自从更新到最新版本的 jQplot 后,条形不再分组:
我想将两个条 [空格] 两个条 [空格] 分组。再一次,这在以前工作得很好......
$(document).ready(function(){
var numCompleted = [4,3,6,5,5,4,0,0,5,4,0,0,0,0];
var numNotCompleted = [1,1,0,0,2,2,8,7,4,4,11,10,1,1];
var dates = ['AM<br>Mon 16','PM','AM<br>Tue','PM','AM<br>Wed','PM','AM<br>Thu','PM','AM<br>Fri','PM','AM<br>Sat','PM','AM<br>Sun','PM'];
plot3 = $.jqplot('complianceChart', [numCompleted,numNotCompleted], {
// Tell the plot to stack the bars.
seriesColors: [ "#81a7d4", "#d0d0d0"],
stackSeries: true,
shadow: false,
//title: 'Exercises completed',
animate: false,
captureRightClick: false,
grid:{drawGridLines: false, shadow : false},
legend: {
show: true,
showLabels: true,
labels: ['Completed exercises','Assigned exercises'],
showSwatches: true,
location: 'e',
placement: 'outsideGrid'
},
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
barMargin: 10,
barPadding: 0,
shadowOffset: 0,
groups:7,
highlightMouseDown: false
},
pointLabels: {show: false,hideZeros: false,edgeTolerance : 10}
},
grid: {
gridLineColor: '#fff',
borderWidth:0,
shadow: false,
background: "white"
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: dates,
showTickMarks: false
},
yaxis: {
showTicks: false
}
}
});