Does anyone know how one can set the label or title of an axis in Flot?
I\'ve read the API but it doesn\'t seem to have that feature...
Thanks :)
A suggestion I saw that works pretty well is to put the graph in the middle of a 3x3 table. Then the labels can be put in the others cells.
<table style="text-align:center">
<tr>
<td></td>
<td>Plot Title Goes Here</td>
<td> </td>
</tr>
<tr>
<td>Y Axis Label</td>
<td>
<div id="graph here" style="width:600px;height:300px"></div>
</td>
<td></td>
</tr>
<tr>
<td></td>
<td>X Axis Label Goes Here</td>
<td></td>
</tr>
</table>
$("<div class='axisLabel yaxisLabel'></div>")
.text("Pressure")
.appendTo($("#yl_1"));
This will works too.
Example for 2dims graph (x and y axis) solved with pure css.
Y axis:
#placeholder:after {
content: 'Speed';
position: absolute;
top: 50%;
left: -50px;
font-weight: 600;
/* Safari */
-webkit-transform: rotate(-90deg);
/* Firefox */
-moz-transform: rotate(-90deg);
/* IE */
-ms-transform: rotate(-90deg);
/* Opera */
-o-transform: rotate(-90deg);
/* Internet Explorer */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
X axis:
#placeholder:before {
content: 'Time';
position: absolute;
bottom: -30px;
left: 50%;
font-weight: 600;
}