Flot中的x轴标签

Joe*_*itt 4 flot

我要做的就是标记我的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即使现在我还需要图书馆吗?

这是有关情节的当前草案.有任何想法吗?

Rai*_*ica 5

即使现在我还需要jquery.flot.axislabels.js库吗?

是.

很简单,标准Flot没有插件的轴标签功能.