我想做的就是给我的x轴打标签:
function doPlot(position) {//Flot
$.plot("#placeholder", [//data
{
data: theta_plot,
label: "Angle (rad)",
yaxis: 1,
color: "red"
},
{
data: omega_plot,
label: "Angular Velocity (rad/sec)",
yaxis: 2,
color: "green"
},
{
data: e_plot,
label: "Energy (J)",
yaxis: 3,
color: "blue"
}
],//options
{
xaxis: {
axisLabel: "Time (sec)",
axisLabelUseCanvas: true
},
yaxes: [
{ font: { color: "red" } },
{ font: { color: "green" } },
{ font: { color: "blue" } },
{ alignTicksWithAxis: position === "left" ? 1 : null }
],
legend: {
position: "nw",
labelBoxBorderColor: null
}
}
);
}
doPlot("left");
我不明白为什么这不起作用。这应该是一个易于理解的问题。我能提供的唯一解决方案是两年前的这个。现在我还需要
jquery.flot.axislabels.js
库吗?这里是问题图表的最新草稿. 有什么想法?