Page 1 of 1
Question about RotateLabel
Posted: Fri Oct 09, 2015 6:55 pm
by 16570614
Hello,
I am using TChart 2015.15.150420 32 bit and I am using Canvas3D.RotateLabel to draw a rotated text. The last parameter of the RotateLabel procedure is AllowHTML which I set to true. What HTML should I use to present a subscript character?
Regards
Re: Question about RotateLabel
Posted: Tue Oct 13, 2015 3:24 pm
by yeray
Re: Question about RotateLabel
Posted: Tue Oct 13, 2015 4:23 pm
by 16570614
Hello Yeray,
I tried that but unfortunately it does not work, my actual code is:
Code: Select all
procedure TMainForm.Chart11AfterDraw(Sender: TObject);
begin
...
TChart(Sender).Canvas.RotateLabel(X, Y, '<SUB>SubScript Text Here</SUB>', 45 , true);
end;
Am I missing something?
Re: Question about RotateLabel
Posted: Wed Oct 14, 2015 9:53 am
by narcis
Hello johnnix,
It works for me compared with non-subscript text, for example:
Code: Select all
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var X, Y: Integer;
begin
TChart(Sender).Canvas.Font.Size:=15;
X:=100;
Y:=X;
TChart(Sender).Canvas.RotateLabel(X, Y, 'Normal Text <SUB>SubScript Text Here</SUB>', 45 , true);
end;
Re: Question about RotateLabel
Posted: Wed Oct 14, 2015 5:24 pm
by 16570614
Hello Narcis,
Could it be my version? I just tried a plot Title in HTML and that does not work also (double clicked a plot -> Titles -> Options -> Format HTML)
Re: Question about RotateLabel
Posted: Thu Oct 15, 2015 7:59 am
by yeray
Hello,
I've just checked it works in v2015.15 for me here:
- Subscript.png (4.71 KiB) Viewed 28940 times
The position of the Subscript text isn't correct with oblique angles, but the text and the font size look correct.
Note I've added this to output the build version string on the chart title:
Code: Select all
uses TeeConst;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.Title.Text.Text:=TeeMsg_Version;
end;
Re: Question about RotateLabel
Posted: Thu Oct 15, 2015 6:37 pm
by 10046032
... does not work for me
What could be the issue?
Re: Question about RotateLabel
Posted: Fri Oct 16, 2015 11:47 am
by yeray
Hello,
What IDE are you using?
Re: Question about RotateLabel
Posted: Fri Oct 16, 2015 12:19 pm
by 16570614
Hello,
Delphi XE7 Version 21.0.17707.5020
Re: Question about RotateLabel
Posted: Fri Oct 16, 2015 3:33 pm
by yeray
Hello,
Looking again at your screenshot I've seen what is making the difference here: RotateLabel method doesn't support HTML5 tags in GDI Canvas.
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1343
In the meanwhile you can use GDIPlus instead of GDI.
Re: Question about RotateLabel
Posted: Sun Oct 18, 2015 7:43 am
by 16570614
Understood
Re: Question about RotateLabel
Posted: Wed Feb 15, 2017 1:20 pm
by yeray
Hello,
Reviewing if it's worth implementing the support for the HTML in RotateLabel, doesn't GDIPlus satisfy your needs?
Re: Question about RotateLabel
Posted: Wed Mar 01, 2017 8:40 am
by yeray
Hello,
#1343 has been closed as "Won't Fix". We recommend moving to GDIPlus.