Printing issue with TeeChart Pro 2011 for Delphi XE2

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by marder » Thu Mar 22, 2012 1:01 pm

Hi.

I encountered an issue whith the fonts when printing with TeeChart Pro 2011 for Delphi XE2.

With Delphi 2010 the printed export looks as expected:
Image
With Delphi XE2 the fonts of the legend and the hints looks very strange:
Image

I use TChart.PrintPartial() for printing.

Is this a known issue?
Is there a fix or workaround for this?

Thanks for your help!

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

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by Narcís » Fri Mar 23, 2012 12:45 pm

Hi marder,

This works fine for me here with Delphi XE2 using this code:

Code: Select all

uses VCLTee.Series, VCL.Printers;

procedure TForm2.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TPieSeries.Create(Self)).FillSampleValues;
  Chart1.Legend.Alignment:=laBottom
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
  Printer.Orientation:=poLandscape;
  Printer.BeginDoc;
  Chart1.PrintPartial(Rect(0,0,Printer.PageWidth,Printer.PageHeight));
  Printer.EndDoc;
end;
Which TeeChart version are you using? Does this occur with different printers?

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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by marder » Fri Mar 23, 2012 1:51 pm

Hi Narcis,

I tried the code you send me, but this however leads to the same result.
When I use the code in a simple sample project with chart and pie series default settings, all works as expected :(
Anyway, the printing works correctly with Delphi 2010.

I will try to build a sample project including my settings were this issue occurs.
Contact you soon...
Last edited by marder on Fri Mar 23, 2012 1:53 pm, edited 1 time in total.

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by marder » Fri Mar 23, 2012 1:52 pm

P.S.: This issue is not specific for one printer. I tried with several printers.

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

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by Narcís » Fri Mar 23, 2012 2:20 pm

Hi marder,
When I use the code in a simple sample project with chart and pie series default settings, all works as expected :(
Thanks for the feedback.
I will try to build a sample project including my settings were this issue occurs.
Yes, please, that will help.
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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by marder » Fri Mar 23, 2012 2:46 pm

Hi Narcis.

I found the reason that causes this issue!

I am using TGDIPlusCanvas form unit VCLTee.TeeGDIPlus as Canvas for the chart.
Please add

Chart1.Canvas := TGDIPlusCanvas.Create;
to the OnCreate event of the main form to see this issue.

Note: I use TGDIPlusCanvas to prevent an issue with the Anti-Alias tools in TeeChart Pro 2011 which I reported before
(See: http://www.teechart.net/support/viewtop ... f=3&t=9180)

So what should I do now?
Do I have to decide between fancy chart in GUI or fancy chart in printed export :wink:

Thanks for your help!

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

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by Narcís » Fri Mar 23, 2012 3:11 pm

Hi marder,

I don't get strange fonts as you did using the code you posted. What about antialiasing GDI+ canvas and font?

Code: Select all

procedure TForm2.FormCreate(Sender: TObject);
var g: TGDIPlusCanvas;
begin
  Chart1.AddSeries(TPieSeries.Create(Self)).FillSampleValues;
  Chart1.Legend.Alignment:=laBottom;
  g:=TGDIPlusCanvas.Create;
  g.AntiAlias:=True;
  g.AntiAliasText:=gpfBest;
  Chart1.Canvas := g;
end;
If the problem persists could you please let us know the exact TeeChart version you are using and attach a simple example project we can run "as-is" to reproduce the problem here?

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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by marder » Mon Mar 26, 2012 9:56 am

Dear Narcis.
I don't get strange fonts as you did using the code you posted.
Please take a look at the printed chart with common canvas:
Image
And here the printed chart with gdi+ canvas:
Image
The printed font in the hints and legend looks quite strange.
What about antialiasing GDI+ canvas and font?
In my version of TeeChart Pro "AntiAlias:=True" and "AntiAliasText:=gpfBest" are the default settings of TGDIPlusCanvas.
I see no effect when I set them again after creation.
If the problem persists could you please let us know the exact TeeChart version you are using
From the "Release.txt":
Release Notes 17th November 2011
TeeChart VCL version 2011
Build 2011.04.41118

and attach a simple example project we can run "as-is" to reproduce the problem here
Please find a sample project here
http://download.jam-software.de/treesiz ... tPrint.zip

Thanks for your help and best regards.

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

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by Narcís » Mon Mar 26, 2012 10:25 am

Dear marder,

Neither the images nor the examples project links are working. Could you please check them or attach the files in the forums?

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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by marder » Mon Mar 26, 2012 11:17 am

Dear Narcis.

Sorry, the links are currently not available.
I attached the files to this post.

Thanks and best regards.
Attachments
TestChartPrint.zip
pie chart print demo project
(82.19 KiB) Downloaded 910 times
pie_chart_print_with_gdi_plus_canvas.png
pie chart with gdi+ canvas
pie_chart_print_with_gdi_plus_canvas.png (72.93 KiB) Viewed 22591 times
pie_chart_print_with_common_canvas.png
pie chart with common canvas
pie_chart_print_with_common_canvas.png (76.7 KiB) Viewed 22590 times

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

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by Narcís » Mon Mar 26, 2012 11:59 am

Hi marder,

Thanks for the files. I see, fonts could be much better with PrintPartial. I have added the issue (TV52016107) to the bug list. In the meantime, I recommend you to use StretchDraw as explained here. I checked this works fine with your project.
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

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by marder » Mon Mar 26, 2012 3:08 pm

Dear Narcis.

Thanks for your help!
Using StrechDraw() with a bitmap seems to work better.

I'm currently trying to include this to my existing code, which is not that easy since there is some other stuff printed beside the chart.
I will contact you again if I need additional help.

Thanks and best regards.

marder
Advanced
Posts: 115
Joined: Thu May 29, 2008 12:00 am

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by marder » Tue Mar 27, 2012 10:04 am

Dear Narcis.

Ok, I managed to bring text and chart (bitmap) together on one printed export.

Anyway, when using your workaround the resolution of the printed export is not as good as when using PrintPartial.
This is because, when generating the bitmap, we use the dimensions of the TChart component. For printing the dimensions of the printer are used, since we want to use the whole page.
In case of using the dimensions of the printer also for exporting the bitmap, the hints and the legend are shown unreadable small (See attachment).

Best regards.
Attachments
pie_print_with_too_small_hint_and_legend.png
pie chart with unreadable small hint and legend
pie_print_with_too_small_hint_and_legend.png (40.7 KiB) Viewed 22563 times

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

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by Yeray » Wed Mar 28, 2012 1:28 pm

Hi marder,

You could try to increase the marks and legend fonts before generating the image to be printed.
I'd also suggest you to take a look at the printing better article here
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

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

Re: Printing issue with TeeChart Pro 2011 for Delphi XE2

Post by Yeray » Wed Nov 07, 2012 12:18 pm

Hi,

We've just checked it with the actual v2012.07 and the example you posted above now seems to produce nice fonts, using PrintPartial and GDI+
Could you please give it a try?
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

Post Reply