CustomChartRect and Print Margins

TeeChart for ActiveX, COM and ASP
Post Reply
Danil Vilaev
Newbie
Newbie
Posts: 3
Joined: Wed Jun 16, 2010 12:00 am

CustomChartRect and Print Margins

Post by Danil Vilaev » Tue Sep 14, 2010 7:06 am

Hello,
I am using CustomChartRect=true and ChartRect() to set chart bounds to fixed numbers. Everything is OK, except when I want to print the chart.
It seems that custom ChartRect coordinates do not add up with the print margins, so the chart is placed in the left-top corner of the page with no regards to margins, which causes chart clipping. I guess I have to add manually print margins to the ChartRect coordinates before printing and subtract them after printing, but I cannot find the correct values.

You can easily replicate this issue, by modifing "Examples\Visual Basic\Visual Basic 5 & 6\Printing" by adding to the Form_Load something like

Code: Select all

TChart1.CustomChartRect = True
TChart1.ChartRect 10, 10, 210, 160
As you can see from attached screenshots, everything looks OK on the print preview page, but the actual print result is incorrect.
Any ideas on how to print this chart correctly?

Regards, Danil.
Attachments
scr2.jpg
The actual print result (shown in Microsoft Office Document Imaging)
scr2.jpg (67.01 KiB) Viewed 11832 times
scr1.jpg
Print preview
scr1.jpg (42.92 KiB) Viewed 11825 times
scr0.jpg
Modified "Printing" example
scr0.jpg (32 KiB) Viewed 11810 times

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

Re: CustomChartRect and Print Margins

Post by Yeray » Wed Sep 15, 2010 1:18 pm

Hi Danil,

Could you please send us a simple example project we can run a-is to reproduce the problem here?
Thanks in advance.
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

Danil Vilaev
Newbie
Newbie
Posts: 3
Joined: Wed Jun 16, 2010 12:00 am

Re: CustomChartRect and Print Margins

Post by Danil Vilaev » Wed Sep 15, 2010 1:37 pm

Hello Yeray,
I'm attaching the sample project.
Regards, Danil.
Attachments
print_margins.zip
(2.87 KiB) Downloaded 710 times

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

Re: CustomChartRect and Print Margins

Post by Yeray » Fri Sep 17, 2010 10:49 am

Hi Danil,

I've seen it happens also in VCL. I've added it to the defect list to be fixed in future releases (TV52015163).
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

Danil Vilaev
Newbie
Newbie
Posts: 3
Joined: Wed Jun 16, 2010 12:00 am

Re: CustomChartRect and Print Margins

Post by Danil Vilaev » Fri Sep 17, 2010 11:51 am

Hi Yeray,
Can you estimate how long it will take to fix this bug?

Is there a way to avoid this bug by using temporary fix, like adding margins to ChartRect before printing and subtracting them after printing? Do you have any ideas what values should be used for that? I've tried using Printer.MarginTop * Printer.PageHeight/100, but that is too big number.

Regards, Danil.

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: CustomChartRect and Print Margins

Post by TonyVSUK » Tue Sep 21, 2010 8:00 am

Danil Vilaev wrote:Can you estimate how long it will take to fix this bug?
I'm another TChart user, and I've don't think any bug/report I have made has ever been fixed. The answer is always "added to the list for future releases". And even with the recent beta of TChart v2010, none of the bugs/issues I have reported have made it in.

So my guess is that if you've found a bug, you have to live with it, it's unlikely ever to be fixed and included in TChart. TChart is a great control, but the frequency of updates/fixes is appalling.

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

Re: CustomChartRect and Print Margins

Post by Yeray » Tue Sep 21, 2010 9:14 am

Hi,
Danil Vilaev wrote:Is there a way to avoid this bug by using temporary fix, like adding margins to ChartRect before printing and subtracting them after printing? Do you have any ideas what values should be used for that? I've tried using Printer.MarginTop * Printer.PageHeight/100, but that is too big number.
One workaround could be printing the image as a bitmap (smooth) if possible. You could do this with a TeePreview:

Code: Select all

TeePreviewer1.Chart = TChart1
TeePreviewer1.Options.AsBitmap = True
TeePreviewer1.ShowPreview
Another workaround could be calculating the margins into the OnBeforePrint event, reassigning the original ChartRect and changing the ChartRect in the Previewer panel, instead of the base chart.
Danil Vilaev wrote:Can you estimate how long it will take to fix this bug?
I'm afraid I can't tell you a date for this to be fixed. I've incremented its priority.
TonyVSUK wrote:I'm another TChart user, and I've don't think any bug/report I have made has ever been fixed. The answer is always "added to the list for future releases". And even with the recent beta of TChart v2010, none of the bugs/issues I have reported have made it in.

So my guess is that if you've found a bug, you have to live with it, it's unlikely ever to be fixed and included in TChart. TChart is a great control, but the frequency of updates/fixes is appalling.
I'm sorry to hear this. If you want, you can tell us the list of the bugs you've reported or the ones you are waiting for (better in a new thread) and we'll try to explain the status on each them.
We do our best to implement bug fixes and new features permanently, but it's always a sensitive compromise.
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

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

Re: CustomChartRect and Print Margins

Post by Narcís » Wed Nov 10, 2010 12:21 pm

Hello,

Just wanted to let you know that TV52015163 has been fixed in TeeChart Pro 2010 VCL. Since TeeChart Pro ActiveX is a COM wrapper of TeeChart Pro VCL you may expect this being fixed for next TeeChart Pro 2010 ActiveX maintenance release.
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

Post Reply