Page 1 of 1

About TChartTitle.DrawTitle

Posted: Wed Aug 26, 2009 9:24 am
by 10046032
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

Re: About TChartTitle.DrawTitle

Posted: Wed Aug 26, 2009 2:29 pm
by narcis
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.

Re: About TChartTitle.DrawTitle

Posted: Thu Aug 27, 2009 5:45 am
by 10046032
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

Re: About TChartTitle.DrawTitle

Posted: Thu Aug 27, 2009 10:22 am
by yeray
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?

Re: About TChartTitle.DrawTitle

Posted: Thu Aug 27, 2009 11:52 am
by 10046032
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

Re: About TChartTitle.DrawTitle

Posted: Thu Aug 27, 2009 12:17 pm
by yeray
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.

Re: About TChartTitle.DrawTitle

Posted: Fri Aug 28, 2009 9:05 am
by 10046032
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

Re: About TChartTitle.DrawTitle

Posted: Fri Aug 28, 2009 11:13 am
by narcis
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.