-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rotate label #4
Comments
I haven't used flot in several years so I have only tested this on version 0.8.3 which was the last stable version before the new maintainers took over. (v0.8.3 is still available here http://www.flotcharts.org/downloads/ or in the example directory of this repository) It's unfortunate Flot wasn't updated to support rotated text because it's actually pretty easy. You will need to modify jquery.flot.js or download the modified version from this repository (Please see the notes I added to the README). In jquery.flot.js at the end of position.element.css({
top: Math.round(y),
left: Math.round(x),
'text-align': halign,
transform: 'rotate('+angle+'deg)' // Add this line
}); I have updated this plugin to support the angle option, updated the README and added an example. I hope this helps. I'm closing this issue since I think this is the best solution I can offer. |
It 's working well. Thank you for your help ! |
Reopened by accident |
Hello,
Is it possible to rotate the label 90° ?
I tried to rotate de context, as following, before/after the call to addText but it does not work.
The angle parameter is not used by Flot so it cannot work neither.
barLabels.context.rotate(270 * Math.PI / 180);
barLabels.addText(layer, px, py, text, series.labels.font, angle, width, halign, valign); (Line 146)
Thanks for any idea !
The text was updated successfully, but these errors were encountered: