Page 1 of 1
Wrong chart title position on print
Posted: Mon Aug 08, 2016 12:25 pm
by 16578771
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.
- Screenshot of the chart printed to a PDF
- TChart-Test2.png (38.21 KiB) Viewed 15422 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
Re: Wrong chart title position on print
Posted: Tue Aug 09, 2016 10:50 am
by 10050769
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.
Hoping this helps you
Thanks in advance,
Re: Wrong chart title position on print
Posted: Tue Aug 09, 2016 12:49 pm
by 16578771
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
Re: Wrong chart title position on print
Posted: Wed Aug 10, 2016 12:38 pm
by 10050769
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
Re: Wrong chart title position on print
Posted: Thu Aug 11, 2016 7:31 am
by 16578771
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
Re: Wrong chart title position on print
Posted: Thu Aug 11, 2016 11:35 am
by 10050769
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,
Re: Wrong chart title position on print
Posted: Wed Jan 04, 2017 2:02 pm
by 16479503
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
Re: Wrong chart title position on print
Posted: Thu Jan 05, 2017 10:10 am
by yeray
Hello Juergen,
Have you tried the workaround Sandra suggested
above?
Re: Wrong chart title position on print
Posted: Thu Jan 12, 2017 9:15 am
by 16479503
Hello Yeray,
sorry for my late answer.
Yes, the workaround solves the problem.
Accidentally I've tried it with
instead of
That was the reason it seemed not working.
Thank you.