Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

tick label overlap Y-axis #822

dnschnur opened this Issue Sep 28, 2012 · 4 comments


None yet
2 participants

dnschnur commented Sep 28, 2012

Original author: qiulih...@gmail.com (August 23, 2012 06:49:46)

if the tick label is 'aaaaaaaaaaaaaaa', canvas' measureText() , calculated the str length is 60px, so in the label area, the pointer backforward 60px + padding value, so ideally, the string should never overlab the line. but, when 'aaaaaaaaaaaaaaa' print on the screen, measure it, its actual length is 90px, so it overlap the line. and for another example, the string is 'lllllllllllllll', measureText() got the width is 45px, but measure it on the screen, it only 30px, so that it will not overlap, but still not correct, for the right has a more gap, which is not our expect(expected is just the padding value)
^ (pointer move back to here)..............................................|

draw text from box.width-box.padding-measureText(username).width
ideally, there will always a box.padding between Y-axis, but under chrome, it doesn't work as expected.

Original issue: http://code.google.com/p/flot/issues/detail?id=743

@dnschnur dnschnur was assigned Feb 27, 2013


dnschnur commented Mar 31, 2013

I've tested against the full range of browsers, including using Excanvas, and so far the new canvas-text implementation doesn't exhibit this problem. Either the problem was with Chrome, and they've fixed it, or it was fixed as a side-effect of our new font handling.

@dnschnur dnschnur closed this Mar 31, 2013

I still have the problem with 0.8 version.
Here's my browser spec: Version 25.0.1364.160 Ubuntu 12.04
I took a snapshot of my plot.
overlap y alignment


dnschnur commented Jun 25, 2013

@fatemehmd It looks like your plot is in a pop-up dialog. Are you drawing the plot before the dialog is made visible? If so, you're experiencing a different issue more similar to #1014. It's a jQuery/browser limitation that causes .width() to return zero if the parent element is not yet part of the DOM. We're trying to implement a work-around, but your best bet for now is to plot after showing the dialog, or, if you must draw in advance, first show the dialog, plot, then immediately hide it.

Yes I drew the flot before opening the dialog. Thank you for clarifying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment