Question about RotateLabel

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
johnnix
Newbie
Newbie
Posts: 13
Joined: Wed Nov 05, 2014 12:00 am

Question about RotateLabel

Post by johnnix » Fri Oct 09, 2015 6:55 pm

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

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

Re: Question about RotateLabel

Post by Yeray » Tue Oct 13, 2015 3:24 pm

Code: Select all

<SUB>SubScript Text Here</SUB>
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

johnnix
Newbie
Newbie
Posts: 13
Joined: Wed Nov 05, 2014 12:00 am

Re: Question about RotateLabel

Post by johnnix » Tue Oct 13, 2015 4:23 pm

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Question about RotateLabel

Post by Narcís » Wed Oct 14, 2015 9:53 am

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;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

johnnix
Newbie
Newbie
Posts: 13
Joined: Wed Nov 05, 2014 12:00 am

Re: Question about RotateLabel

Post by johnnix » Wed Oct 14, 2015 5:24 pm

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) :(

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

Re: Question about RotateLabel

Post by Yeray » Thu Oct 15, 2015 7:59 am

Hello,

I've just checked it works in v2015.15 for me here:
Subscript.png
Subscript.png (4.71 KiB) Viewed 4835 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;
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

johnnix
Advanced
Posts: 192
Joined: Tue Jul 10, 2007 12:00 am

Re: Question about RotateLabel

Post by johnnix » Thu Oct 15, 2015 6:37 pm

... does not work for me :( What could be the issue?
Attachments
Screenshot 2015-10-15 21.png
Screenshot 2015-10-15 21.png (12.36 KiB) Viewed 4828 times

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

Re: Question about RotateLabel

Post by Yeray » Fri Oct 16, 2015 11:47 am

Hello,

What IDE are you using?
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

johnnix
Newbie
Newbie
Posts: 13
Joined: Wed Nov 05, 2014 12:00 am

Re: Question about RotateLabel

Post by johnnix » Fri Oct 16, 2015 12:19 pm

Hello,

Delphi XE7 Version 21.0.17707.5020

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

Re: Question about RotateLabel

Post by Yeray » Fri Oct 16, 2015 3:33 pm

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

johnnix
Newbie
Newbie
Posts: 13
Joined: Wed Nov 05, 2014 12:00 am

Re: Question about RotateLabel

Post by johnnix » Sun Oct 18, 2015 7:43 am

Understood :)

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

Re: Question about RotateLabel

Post by Yeray » Wed Feb 15, 2017 1:20 pm

Hello,

Reviewing if it's worth implementing the support for the HTML in RotateLabel, doesn't GDIPlus satisfy your needs?
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: 8738
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Question about RotateLabel

Post by Yeray » Wed Mar 01, 2017 8:40 am

Hello,

#1343 has been closed as "Won't Fix". We recommend moving to GDIPlus.
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

Post Reply