Page 1 of 1

Print Quality

Posted: Thu Feb 14, 2008 7:43 pm
by 9340553
This is an old topic for us, but:

The quality of printed TCharts is not very good (at least for line drawings), apparently because TChart does not maintain object sizes and proportions independent of resolution. There are other similar TChart-to-printer issues also, such as annotation placements.

We would like to exploit the high resolutions available on printers, yet still maintain the relative proportions between font sizes, other objects, and chart dimensions, as seen on the display. Line weights and detail should follow the device resolutions. A line width of 1 on the screen should be a width of 1 on the printer (i.e, much finer), but a 10 pt font on the screen should be a 10 pt font on the printer.

If our printer canvas is 4800 x 6000, and we create a metafile of a TChart onto a rect this size, the fonts, tick marks, and other ojects become unreadable, yet the chart dimensions remain as defined.

Are there global properties that we can use to, say, scale all fonts on the chart upward to match the new chart size? Has v8 provided a solution?

Thanks

Kevin

Posted: Fri Feb 15, 2008 9:46 am
by 9337510
No help I am afraid - just to say I have the same problem.

I also have a problem with things like the dragged marks not being attached to the chart and wandering off when you change resolution.

Posted: Fri Feb 15, 2008 12:03 pm
by narcis
Hello everyone,

I recommend you to read the article about printing I posted here.

If it doesn't help don't hesitate to let us know.

Posted: Mon Mar 03, 2008 5:45 pm
by 9340553
Thanks, but this doesn't help. It merely points out old solutions, and acknowledges the problem.

How about a response to the original question?

How to access all objects in the TChart that need scaling (fonts, text boxes, etc.) so we can scale them onto the metafile canvas according to the canvas size?

Is there a list of annotations, for example?
A list of Fonts?

Note that this issue also occurs with a simple change of paper size (A4 vs A3, for example).

Kevin

Posted: Tue Mar 18, 2008 4:33 pm
by narcis
Hi Kevin,

Sorry for the delayed reply.
How about a response to the original question?
A solution to this issue is making the chart bigger before printing as Pep described on this thread.
How to access all objects in the TChart that need scaling (fonts, text boxes, etc.) so we can scale them onto the metafile canvas according to the canvas size?
For printting you need to set font height instead of font size:

1) If you're printing text, have you used Font.Height instead of Font.Size for font "size" ? This is important because if you are "painting" canvas to printer.canvas then you must use Font.Height (negative value!) to define font "size". Something like this:

Code: Select all

Chart1.Canvas.Font.Height := -11;
For more on Height vs. Size check Delphi help file.

2) The problem is all custom positioned object (rectangles, text, series marks) use screen pixels coordinates. While this is fine for screen it does not work for printer. Why ? The reason for this is if you print, TeeChart will internally change chart size (so that it fits in specified printer.Canvas region). The result is Chart size will change but the custom positioned items "positions" on printer canvas will remain the same (in screen pixel coordinates). This will result in custom items being drawn at wrong place. The solution : Ignore PrintPartialCanvas method and rather use the following method to print chart(s):

Code: Select all

var tmpMeta: TMetaFile;
    OldColor : TColor;
begin
    Chart1.BevelOuter := bvNone;
    OldColor := Chart1.Color;
    Chart1.Color := clNone;
    tmpMeta := Chart1.TeeCreateMetafile(true,Chart1.ClientRect);
    try
        Printer.Orientation := poLandscape;
        Printer.BeginDoc;
        try
            Printer.Canvas.StretchDraw(Rect(1,1,Printer.PageWidth - 1,
                Printer.PageHeight - 1),tmpMeta);
        finally
            Printer.EndDoc;
        end;
    finally
        tmpMeta.Free;
        Chart1.BevelOuter := bvRaised;
        Chart1.Color := OldColor;
    end;
end;
If this doesn't help don't hesitate to let us know.

Posted: Tue May 06, 2008 10:10 am
by 9343260
Hello,

I would like to show you a comparison about the print quality in TeeChart :

I have opened exactly the same points in TeeChartOffice and in another software I have. I printed both charts and scanned it so that we can clearly see the difference. For TeeChart, I used a Metachart, but I tried several methods and I can't have a better quality :

Image

Unfortunately I have no idea how this other software handles printing. It was an old soft created about 10 years ago in C++. My customers ask me to improve the print quality, as they were used to this old software with a really good quality.

I tried many solutions to have the best quality possible with TeeChart (direct print, metachart, etc.), but I can't do better than the picture you see in this message.

My question is : do you think there is a way to reach such a good quality as the "Other printing" ? I can send you the data I used if it helps.

Posted: Wed May 14, 2008 12:55 pm
by narcis
Hi bertrod,

You may be interested in reading the Printing better article I pointed in a previous reply.

Hope this helps!