Page 1 of 1

multiline headers and labels

Posted: Tue Oct 25, 2011 7:42 pm
by 15960028
I'm not having any luck creating multiline text in headers or labels in graphs

The tutorial say the following:

MultiLine labels

Axis labels can be displayed as multi-line text instead of a single line of text. Lines are separated using the TeeLineSeparator global constant, which by default is the carriage-return ascii character ( #13 ).

I searched the source code there is no 'TeeLineSeparator' defined that I can find. I tried inserting ascii (13) chars into a label string, and it performs a carriage return so all parts end up on 1 line on top of each other unreadable. I then tried adding an ascii (10) line feed in after the carriage return and that causes an error in the source.

The multiline example from the tutorial is a similar experience.
from the tutoria...
You may add several lines to the Header:

e.g.

$tChart1->getHeader()->setLines(new String[] {"Welcome to", "TeeChart", "for PHP"});


This line produces the following error.. "Parse error: syntax error, unexpected '[' ..." , I don't know what this line was trying to do.. I can't find evidence of a String class in the source code. I've tried cleaning this up a few ways and had no luck.

I've tried just making a simple array of strings..
$aa= array('line 1',line 2','line 3');

and passing that .. $tChart1->getHeader()->setLines($aa);

that produces a warning but the header is not set
Warning: imagettftext() expects parameter 8 to be string, array given in ...tcsource/GraphicsGD.php on line 2044

How do you create multiline header/footer/ titles and how do you create multiline labels ??

Re: multiline headers and labels

Posted: Fri Oct 28, 2011 9:52 am
by yeray
Hello,

The tutorial 4 seems to be wrong when it talks about MultiLine Labels. I've added it to the defect list to be fixed in next releases (TF90015802).
In the header you could use the subheader to achieve the multiline. However, regarding the multiline labels we are investigating what's happening because it gives me an error when I set:

Code: Select all

$tChart1->getAxes()->getBottom()->getLabels()->setMultiLine(true);

Re: multiline headers and labels

Posted: Thu Nov 10, 2011 9:51 am
by yeray
Hello,

We've done some changes in the sources so now the series marks and the axes labels can show multiline texts (with "\n" as separator).
Find attached the affected files.
MultiLine_changes.zip
(32.71 KiB) Downloaded 2470 times

Re: multiline headers and labels

Posted: Thu Nov 17, 2011 5:34 pm
by 15960028
Excellent thank you for posting the fix! I was expecting that to be fixed in the next release in 2012.