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
我試圖建立一個,但無法使其工作。如果我最終得到其他問題,我會更多地考慮它。謝謝! –