How to draw title of a legend on the right (along a legend)

TeeChart for ActiveX, COM and ASP
Post Reply
Kabal
Newbie
Newbie
Posts: 19
Joined: Mon Mar 13, 2006 12:00 am

How to draw title of a legend on the right (along a legend)

Post by Kabal » Wed Apr 26, 2006 5:18 am

and rotated on 90 degrees. To look like title of axis.

Best regards, Rustam

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

Post by Narcís » Wed Apr 26, 2006 7:44 am

Hi Rustam,

To achieve that you'll need to custom draw on TChart's canvas in the OnAfterDraw event by doing something like this:

Code: Select all

Private Sub TChart1_OnAfterDraw()
    X = TChart1.Legend.ShapeBounds.Right + 5
    Y = TChart1.Legend.ShapeBounds.Top + (TChart1.Legend.ShapeBounds.Bottom - TChart1.Legend.ShapeBounds.Top) / 1.5
    TChart1.Canvas.RotateLabel X, Y, "Legend Title", 90
End Sub
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

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

Post by Narcís » Fri Apr 28, 2006 2:50 pm

Hi Rustam,

Using the example I posted in the attachments newsgroup, you can see as the legend symbols change. The legend values doesn't change as they are based on the point labels.
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

Post Reply