爲什麼我的y軸放錯了位置,我該如何修復它?我不明白爲什麼'y'軸位於圖表的頂部。任何想法讚賞。將y軸標籤放置在條形圖上,JQuery
這些是我使用的選項。我嘗試過抓住生成的y軸類,並手動使用css將其向左移動幾個像素,但整個圖形只是轉移過來。據我所見,API中沒有任何東西將y軸ticker標籤相對於圖形進行移動。
var options = {
colors: ["#99CCFF", "#000099", "#FF6C47"],
series: {
lines: {show: true, highlightColor:'#000099'},
points: {show: true}
},
xaxis: {
mode: "time",
timeformat: "%d/%m",
markings: [{color: "#000"}],
},
yaxis: {
markings: [{color: "#000"}]
},
grid: {
markings: [{color: "#fff"}],
labelMargin: 10,
axisMargin: 10,
backgroundColor: {
colors: [ "#000099", "#29A3CC" ]
},
borderWidth: {
top: 1,
right: 1,
bottom: 2,
left: 2
}
},
legend: {
show: true,
backgroundOpacity:.5,
labelBoxBorderColor: 1,
position: "nw",
margin: 5
}
};
$.plot("#bpTable", [
{label: "systolic", data: c1},
{label: "diastolic", data: c2}
],
options);
圖片讓我們的人瞭解你的問題,但爲了幫助你解決問題,你必須提供(部分)你的源代碼並解釋你試過的東西。 – DanFromGermany
我想你是在隱藏的div內繪製圖表('
')你是在手風琴或製表符中繪製圖表或者當你調用'plot'時沒有附加到'DOM'的東西? –查看http://stackoverflow.com/questions/5427725/flot-graph-does-not-render-when-parent-container-is-hidden,尤其是我最近對https://github.com/flot/flot發表的評論/ issues/1014 – DNS