Page 1 of 1

CustomChartRect and Print Margins

Posted: Tue Sep 14, 2010 7:06 am
by 15056428
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.

Re: CustomChartRect and Print Margins

Posted: Wed Sep 15, 2010 1:18 pm
by yeray
Hi Danil,

Could you please send us a simple example project we can run a-is to reproduce the problem here?
Thanks in advance.

Re: CustomChartRect and Print Margins

Posted: Wed Sep 15, 2010 1:37 pm
by 15056428
Hello Yeray,
I'm attaching the sample project.
Regards, Danil.

Re: CustomChartRect and Print Margins

Posted: Fri Sep 17, 2010 10:49 am
by yeray
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).

Re: CustomChartRect and Print Margins

Posted: Fri Sep 17, 2010 11:51 am
by 15056428
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.

Re: CustomChartRect and Print Margins

Posted: Tue Sep 21, 2010 8:00 am
by 9530487
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.

Re: CustomChartRect and Print Margins

Posted: Tue Sep 21, 2010 9:14 am
by yeray
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.

Re: CustomChartRect and Print Margins

Posted: Wed Nov 10, 2010 12:21 pm
by narcis
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.