为什么我的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