我要做的就是标记我的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");
Run Code Online (Sandbox Code Playgroud)
我不明白为什么这不起作用.这应该是一个明智的选择.我能想到的就是这两年了.jquery.flot.axislabels.js即使现在我还需要图书馆吗?
这是有关情节的当前草案.有任何想法吗?
| 归档时间: |
|
| 查看次数: |
7394 次 |
| 最近记录: |