Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

having the line height causes labels to be pushed to close to the border... #10

Closed
wants to merge 1 commit into from

2 participants

@dbradicich

...s and cut off in certain cases

@borgar
Collaborator

This will cause text line-height to be at the mercy of whatever CSS might be present in the document. That is to say, we would be giving up control over horizontal line positioning to a degree. That's not going to end well.

Do you have test cases for the problem you are trying to solve? What are the cases you cite where unexpected things are happening?

sorry, should have included some background info here ;) we have a donut chart with labels, and when the labels are displayed for the donut wedge, the top of the label is chopped off as so

http://screencast.com/t/SHwQC74q6

In this case (and our other usage in our app) removing the lineheight resolves the issue, bringing the label just enough so there is no more clipping.

Bit more info, the reason we don't just use a bigger box to put this in is that it is contained in a container which contains an svg chart (where available) and i'd rather not have to define different font sizes for svg/vml unless absolutely necessary. And mind you I am by no means a css master, this change just achieved resolution to my problem

Collaborator

Well, this should not be happening unless you actually positioned the text outside the box. If it is correct in FF/Chrome then it should be correct in MSIE too. :-)

My guess here is that the error is caused by a rounding problem in the label/font size calculation: The font size being rounded down rather than up. If you could supply me with a reduced test then I think I can patch this fairly quickly.

Collaborator

Or, ... If you feel like experimenting then examine what vml.text_dims is doing with the font size:

https://github.com/DataMarket/protovis-msie/blob/master/src/Vml.js#L36

@borgar
Collaborator

I want to fix this but I've tried to replicate this and can't. I have better luck getting this effect in SVG than in VML. I will need this replicated in Protovis code in order to analyze what the problem actually is.

I'm closing this as a "can't reproduce" but feel free to reopen if you can supply a test case.

@borgar borgar closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 30, 2012
  1. @dbradicich

    having the line height causes labels to be pushed to close to the bor…

    dbradicich authored
    …ders and cut off in certain cases
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/VmlLabel.js
View
2  src/VmlLabel.js
@@ -46,7 +46,7 @@ pv.VmlScene.label = function(scenes) {
'left': Math.round( s.left + dx ) + 'px',
'position': 'absolute',
'display': 'block',
- 'lineHeight': 1,
+ //'lineHeight': 1,
'whiteSpace': 'nowrap',
'zoom': 1,
'cursor': 'default',
Something went wrong with that request. Please try again.