All I'm trying to do is label my x-axis:
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");
I don't understand why this doesn't work. This should be a no-brainer. All I could come up with is this, which is two years old. Do I still need the jquery.flot.axislabels.js
library even now?
Here is a current draft of the plot in question. Any ideas?
Do I still need the jquery.flot.axislabels.js library even now?
Yes.
Simple as that, standard Flot has no axis label feature without plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With