Wrong chart title position on print

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
hansw
Newbie
Newbie
Posts: 3
Joined: Tue Jul 26, 2016 12:00 am

Wrong chart title position on print

Post by hansw » Mon Aug 08, 2016 12:25 pm

Hello,

when the chart title position is left justified or right justified then the position on print is wrong. If the position is left justified then the chart title text is not readable (truncated).
For example: Use the following code

Code: Select all

  Chart1->Title->Alignment = taLeftJustify;
  Chart1->Title->TextAlignment = taLeftJustify;
  Chart1->Title->Text->Clear();
  Chart1->Title->Text->Add(L"Chart Title Line 1");
  Chart1->Title->Text->Add(L"Chart Title Line 2");
to have two chart title lines which are left justified. Then use the ChartPreviewer component to print the chart => only small parts of the chart title is printed.
TChart-Test2.png
Screenshot of the chart printed to a PDF
TChart-Test2.png (38.21 KiB) Viewed 14647 times
The attached project is for C++Builder 10.1 Berlin using TeeChart Pro 2016.18.

Is there a workaround for this bug?

With best regards

Hans
Attachments
TChart-Test2.zip
Example project to reproduce the issue
(6.83 KiB) Downloaded 608 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Wrong chart title position on print

Post by Sandra » Tue Aug 09, 2016 10:50 am

Hello Hans,

The problem is caused so the Text aren't drawn in the print area, therefore I would like suggest you modify the print area margins, so the titles can be drawn without problems.
To do this, you should add the lines below in the Print button:

Code: Select all

void __fastcall TForm1::Button1Click(TObject *Sender)
{

	Chart1->PrintProportional =false;
	Chart1->PrintMargins =Rect(2, 5, 2, 5);
	ChartPreviewer1->Execute();
}
Also, I have attached the project you sent me, with the modified code.
TChart-Test2Mod.zip
(56.51 KiB) Downloaded 641 times
Hoping this helps you
Thanks in advance,
Best Regards,
Sandra Pazos / 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

hansw
Newbie
Newbie
Posts: 3
Joined: Tue Jul 26, 2016 12:00 am

Re: Wrong chart title position on print

Post by hansw » Tue Aug 09, 2016 12:49 pm

Hello Sandra,

thank you for the quick reply. Your solution works also for the real application. However, I would see the solution as workaround because in the print preview the title is always displayed within the margins. And the chart title left position is in line with the left axis title. So there is no reason for the chart title text to be truncated in the print output.

With best regards

Hans

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Wrong chart title position on print

Post by Sandra » Wed Aug 10, 2016 12:38 pm

Hello Hans,

Seems the problem is caused for the print Orientation. We're investigating where is the problem. Meanwhile, I would suggest you modify the print area margins or enable the Smoothed options before print.

Thanks in advance
Best Regards,
Sandra Pazos / 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

hansw
Newbie
Newbie
Posts: 3
Joined: Tue Jul 26, 2016 12:00 am

Re: Wrong chart title position on print

Post by hansw » Thu Aug 11, 2016 7:31 am

Hello Sandra,

I will stay with the modification of the print area margins, the print output looks "pixelated" if the "Smoothed" option is turned on.

Regards

Hans

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Wrong chart title position on print

Post by Sandra » Thu Aug 11, 2016 11:35 am

Good afternoon Hans,


Finally, after doing some test, I have decided add the problem you are experiencing in the TeeChartVCL bugzilla tracker to fix the problem to upcoming versions. Here's the problem: http://bugs.teechart.net/show_bug.cgi?id=1595
Feel free to add your mail to the CC list of the other tickets to be automatically notified when they'll be updated.

Thanks in advance,
Best Regards,
Sandra Pazos / 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

JRadke
Newbie
Newbie
Posts: 10
Joined: Mon Oct 31, 2016 12:00 am

Re: Wrong chart title position on print

Post by JRadke » Wed Jan 04, 2017 2:02 pm

Hi Sandra,
is there meanwhile a solution available ?
I have the same problem with printing my charts:
The ChartPreview is oK, but on the printer the title text will be truncated in case the alignment of the title is taLeftJustify.
Even if I change it to taRightJustify the position of the text seems not to be exactly on the right side.

Kind regards
Juergen

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

Re: Wrong chart title position on print

Post by Yeray » Thu Jan 05, 2017 10:10 am

Hello Juergen,

Have you tried the workaround Sandra suggested above?
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

JRadke
Newbie
Newbie
Posts: 10
Joined: Mon Oct 31, 2016 12:00 am

Re: Wrong chart title position on print

Post by JRadke » Thu Jan 12, 2017 9:15 am

Hello Yeray,

sorry for my late answer.
Yes, the workaround solves the problem.
Accidentally I've tried it with

Code: Select all

Rect(5, 5, 5, 5);
instead of

Code: Select all

Rect(2, 5, 2, 5);
That was the reason it seemed not working.
Thank you.

Post Reply