1
我想要有一个多个系列条形图(使用orderBars)中间系列需要显示变量抽样的errorBars。我似乎无法得到酒吧在网格中正确对齐,我无法弄清楚如何使其工作。现在到我完成的地方,左边的&右侧横杆已正确对齐,但中间横杆向上跳起并未正确对齐。无法使用jQuery Flot orderBars和错误条对齐条形图
这是我目前编码:
$(function() {
var figure0 = [{
label: "Cost 1",
data: [[1,5229.7], [2,4496.8], [3,4307.0], [4,4205.6], [5,3809.7]],
bars: {
order: 0
}
}, {
label: "Cost 2",
data: [[1,4973.5,500], [2,3380.4,100], [3,3105.7,100], [4,3000.8,100], [5,2939.0,100]],
points: {
radius: 0,
errorbars: "y",
yerr: {
show: true,
upperCap: "-",
lowerCap: "-",
radius: 5,
color: "black"
}
},
bars: {
align: "center",
order: 1
}
}, {
label: "Cost 3",
data: [[1,1045.2], [2,881.8], [3,809.0], [4,850.8], [5,771.5]],
bars: {
order: 2
}
}];
var formatFigure0 = {
series: {
stack: false,
bars: {
show: true,
fill: true,
barWidth: 0.2,
lineWidth: 1,
fillColor: { colors: [{ opacity: 1 }, { opacity: 1 }] }
}
},
xaxis: {
show: true,
ticks: [1, 2, 3, 4, 5],
tickDecimals: 0,
tickSize: 1,
axisLabel: "Quintiles"
},
yaxis: {
show: true,
tickDecimals: 0,
tickSize: 1000,
axisLabel: "Dollars (millions)"
},
legend: {
show: true,
position: "ne",
margin: 10,
},
grid: {
hoverable: false
}
};
$.plot($("#figure0DIV"), figure0, formatFigure0);
});
你可以建立一个[小提琴](http://jsfiddle.net)? – Raidri
我试图建立一个,但无法使其工作。如果我最终得到其他问题,我会更多地考虑它。谢谢! –