问题
I am trying to rotate the label on my X-Axis on my flot graph in a similar way a user asked here - Rotate Flot Tick Labels
The problem I am facing is that it looks like the CSS selector for the X-Axis doesn't select anything. The selector I am using is:
div.xAxis div.tickLabel
{
transform: rotate(-90deg);
-ms-transform:rotate(-90deg); /* IE 9 */
-moz-transform:rotate(-90deg); /* Firefox */
-webkit-transform:rotate(-90deg); /* Safari and Chrome */
-o-transform:rotate(-90deg); /* Opera */
/*rotation-point:50% 50%;*/ /* CSS3 */
/*rotation:270deg;*/ /* CSS3 */
}
I also don't even understand how the graph is even visible. I don't know much about the canvas tag, but it looks like it is completely empty.
I don't understand how the source there is empty. I would think there would be some sort of markup like vector points that represent the graph. Is that just how canvas works? Also, how would you even know what CSS selectors to use at that point if you can't view the source?
回答1:
You are probably using the canvas plugin, and setting canvas: true
in your options. That forces flot to draw the labels on the canvas, rather than putting them where you are expecting (in the divs).
来源:https://stackoverflow.com/questions/16044560/flot-graph-tick-label