Page 1 of 1

Change In Font Height Changes Font Color for TDChart

Posted: Thu Oct 10, 2013 5:04 pm
by 16566624
I am using Delphi XE2 (RAD Studio) with Update 4 HotFix 1. I have just upgraded to the latest TeeChart 9.0.8.0, with source, and had to do a recompile to install into XE2.

Prior to the upgrade everything was working fine. After the upgrade I saw odd behavior in my code being executed in the OnAfterDraw event handler for TDCharts. Specifically in the following code nothing would be displayed for the second TextOut. Remove the change in font height line and both lines display.

Chart.Canvas.TextOut(130, 100, 'Before Font Height Change');
Chart.Canvas.Font.Height := 15;
Chart.Canvas.TextOut(130, 110, 'After Font Height Change'); // NOT DISPLAYED WHEN ABOVE FONT HEIGHT LINE PRESENT

Further more inserting the following line after the Font Height change had no effect.
Chart.Canvas.Font.Color := clBlack;

I have attached a simple project displaying the issue.

Your help/insight would be appreciated.

Re: Change In Font Height Changes Font Color for TDChart

Posted: Fri Oct 11, 2013 11:27 am
by yeray
Hi,

It seems it has always been like this in GDI+. The issue here is that the v2013.08 is the first version to use GDI+ by default. If you want to switch back to GDI you can:

- Set the GDI Canvas for the current application:
· At design time, you can open the editor and select GDI at the Chart/3D/Render tab.
· At runtime, you can add the TeCanvas unit and do this:

Code: Select all

Chart1.Canvas:=TTeeCanvas3D.Create;
- Set the GDI Canvas as the default Render option for the new charts you may create:
At design time, open the Options... dialog in the contextual menu (right click on the chart). Go to the New Chart tab and select GDI as the Render option.

Re: Change In Font Height Changes Font Color for TDChart

Posted: Fri Oct 11, 2013 9:54 pm
by 16566624
That fixed the problem.
Your help is much appreciated.