Chart header properties

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Agrilink
Newbie
Newbie
Posts: 38
Joined: Thu Feb 02, 2006 12:00 am

Chart header properties

Post by Agrilink » Wed Apr 26, 2006 3:14 am

Hi,

Is it possible to apply different font properties for multiple lines of the chart header?

Thanks.

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 8:20 am

Hi Agrilink,

I'm afraid this is not possible. To achieve that you'll have to custom draw on TeeChart's canvas specifing the font settings for each string you draw. To custom draw on the canvas you should use the AfterDraw event:

Code: Select all

      ...
      tChart1.Header.Visible = false;
      tChart1.Panel.MarginTop = 15;
      ...

    void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
    { 
      int x = tChart1.Left + (tChart1.Right - tChart1.Left) / 2;
      int y = tChart1.Top + 5;

      g.Font.Color = Color.Red;
      g.TextOut(x, y, "Title line 1");
      g.Font.Color = Color.Blue;
      g.TextOut(x, y+10, "Title line 1");
    }
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