multiline headers and labels

TeeChart for PHP
Post Reply
ISVA7655
Newbie
Newbie
Posts: 16
Joined: Tue Aug 23, 2011 12:00 am

multiline headers and labels

Post by ISVA7655 » Tue Oct 25, 2011 7:42 pm

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 ??

Yeray
Site Admin
Site Admin
Posts: 9509
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: multiline headers and labels

Post by Yeray » Fri Oct 28, 2011 9:52 am

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);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9509
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: multiline headers and labels

Post by Yeray » Thu Nov 10, 2011 9:51 am

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 1592 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ISVA7655
Newbie
Newbie
Posts: 16
Joined: Tue Aug 23, 2011 12:00 am

Re: multiline headers and labels

Post by ISVA7655 » Thu Nov 17, 2011 5:34 pm

Excellent thank you for posting the fix! I was expecting that to be fixed in the next release in 2012.

Post Reply