ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Line Height on Labels
Posted by drew lanenga on May-30-2012 05:33
Attachments:
I am using setMaxWidth to wrap text on my longer labels, but have size constraint
problems because of the large line break. I have tried setting the height of the label to
bring the two lines of the labels closer together, but it doesn't seem to work. Here is that
snippet of code and a picture of my chart.

$labelobject = $c->xAxis->setLabelStyle($this->fontStyleBd, 8);
$labelobject->setHeight(6);
$labelobject->setMaxWidth(200);
Screen Shot 2012-05-29 at 3.32.50 PM.png

  Re: Line Height on Labels
Posted by Peter Kwan on May-30-2012 23:53
Hi drew,

May be you can try to add the following text before your label text to see if it helps:

<*block,linespacing=0.5*>

For example:

for($i = 0; $i < count($myLabels); ++$i)
    $myLabels[$i] = "<*block,linespacing=0.5*>".$myLabels[$i];

By default, the line spacing is determined by the font designer. (There is a parameter in the font file that specifies the line spacing to use.) Typically, the line spacing is based on the character with the highest ascender (such as Ŷ) and lowest descender (such as g), plus a gap. Even if you do not use these characters, the line spacing is still based on them. (If the line spacing is based on the actual characters you use, then every line will have a different line spacing.) So if you happen to only use characters with small ascender and no descender, the line spacing will look relatively large. The "linespacing" CDML parameter can be used to adjust the line spacing.

Hope this can help.

Regards
Peter Kwan