Page 1 of 1

How to Scale chart into a rectangle to fit the printer page.

Posted: Thu Jan 24, 2008 2:28 pm
by 13045101
Can you show me how to print a chart from a window of user defined size to fit the page of the printer. We need to make the chart.Print(Rectangle) to use System.Drawing.Printing.PageSettings bounds rectangle to print from the chart, as we have our own printer preview screens and custom information etc need to be added before printing.

Posted: Thu Jan 24, 2008 3:40 pm
by narcis
Hi HughM,

What about doing something like the example I posted here?

Need a more generic solution

Posted: Mon Jan 28, 2008 2:17 pm
by 13045101
The example posted in the link does not solve our problem. Print preview is only a constraint in our environment, in fact we use the TChart1.Print(Rectangle) as shown in the link. The problem is scaling for example 1) a maximized window containing the chart prints well on my machine, but a resized window containing the chart only prints partial chart. 2) Different screen resolutions produce different print outputs. I do not clearly understand the conversion factors from view to print.

The solution I am expecting is a generic nature of printing. A Chart print from a view should always fit the printer page on all circumstances.

Posted: Tue Jan 29, 2008 11:33 am
by narcis
Hi HughM,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Issue resolved.

Posted: Thu Jan 31, 2008 3:43 pm
by 13045101
Created an example project to reproduce the problem and found that tchart is printing exactly the way I asked for " A Chart print from a view should always fit the printer page on all circumstances" for resized window and with different screen resolutions.
Thanks for your help anyways.

Posted: Thu Jan 31, 2008 6:15 pm
by narcis
Hi HughM,

Don't mention it! I'm glad to hear you could solve the problem.