About TChartTitle.DrawTitle

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
johnnix
Advanced
Posts: 192
Joined: Tue Jul 10, 2007 12:00 am

About TChartTitle.DrawTitle

Post by johnnix » Wed Aug 26, 2009 9:24 am

Hello,

In TChartTitle.DrawTitle inside Chart.pas the declaration ShapeBounds:= ParentChart.ChartRect; does not return the rectangle formed by Left and Bottom axes but left point is always 0. How can I change that so that the ShapeBounds has left equal to LeftAxes.left and right equal to BottomAxes.Right?

Regards

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

Re: About TChartTitle.DrawTitle

Post by Narcís » Wed Aug 26, 2009 2:29 pm

Hi johnnix,

I'm sorry but we can not support source code modifications. If you are looking into this for fixing a bug existing with the binary release of TeeChart please let us know and we will investigate it.

Thanks in advance.
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
Advanced
Posts: 192
Joined: Tue Jul 10, 2007 12:00 am

Re: About TChartTitle.DrawTitle

Post by johnnix » Thu Aug 27, 2009 5:45 am

Hello Narcis,

Yes, this is a bug which I reported sometime ago. Back then I did not have the sources and since it is not fixed I wanted to investigate it myself. Anyway I was just wondering why the ChartRect property does not return the rectangle formed by Left and Bottom axis.

Regards

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

Re: About TChartTitle.DrawTitle

Post by Yeray » Thu Aug 27, 2009 10:22 am

Hi johnnix,

This is probably because at this moment the axes still haven't been calculated.
Could you please tell us what is the problem you reported time ago?
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: About TChartTitle.DrawTitle

Post by johnnix » Thu Aug 27, 2009 11:52 am

Hello,

The issue with the chart Title is that when the alignment is left it is drawn from the left point of the component rectangle and when the alignment is set to right is looks like it is drawn from the bottom axis right. What I suggested was that the chart title should be drawn relative to the rectangle formed be left and bottom axis.

Regards

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

Re: About TChartTitle.DrawTitle

Post by Yeray » Thu Aug 27, 2009 12:17 pm

Hi johnnix,

Then you could try changing the moment where the title is drawn and make it to be drawn after the axes.
Take a look at the DrawTitlesAndLegend call in TeEngine.pas.
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: About TChartTitle.DrawTitle

Post by johnnix » Fri Aug 28, 2009 9:05 am

Hello,

Thank you very much for the tip although I could not get it work :D I tried placing the following code inside the OnAfterDraw event of the chart and the result was a double drawn Title where the second title is placed horizontally where I need it to be but the vertical Position is wrong. Anyway would you consider adding an option to draw the title using the left and bottom axis bounds?

Code: Select all

(sender as TChart).Title.DrawTitle;
Regards

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

Re: About TChartTitle.DrawTitle

Post by Narcís » Fri Aug 28, 2009 11:13 am

Hi johnnix,

You could try calling Chart1.Draw in OnCreate or your unit's constructor to see if once the chart is plotted such properties have valid values.
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