Tutorial 14 - Printing Charts

  Contents page 
  Previous

Contents

Standard Printing

Simple Print command
Print Orientation
Print Preview
Print Resolution
Greyscale printing

Extended Printing methods

PrintPartial


Standard Printing

TeeChart Pro offers standard print methods to print the Onscreen Chart 'as is' to the Printer.

Simple Print command

To print a Chart use the Print method. This will print the chart as it appears onscreen.

Example

Chart1.Print;

Print Orientation

The PrintPortrait and PrintLandscape methods allow you to print those orientations even if they are not defined as the default. The default orientation will take effect again after the print is complete. Default Orientation can be changed using the PrintOrientation method. The Orientation method will not print or you. You must run Print after changing the PrintOrientation.

Example

With Chart1 do
begin
  PrintOrientation(poLandscape);
  Print;
end;

Print Preview

The PrintPreview window will show you how the Chart will appear when printed. You may modify print parameters in the Print Preview window before sending the job to the Printer. To call PrintPreview run:

// Add the teeprevi unit to the Uses part of your project
ChartPreview(Self,Chart1);

Print Resolution

Print Resolution refers to the level of Chart detail to be printed and is not to be confused with printer resolution which is defined with your Printer setup in Windows' Print management. TeeChart Print Resolution defines the amount of TeeChart detail to be included in the printed Chart, its Axis scale detail, Gridline frequency, etc. The value range is a percentage from 0-100%.

Example

//this will use screen resolution
Chart1.PrintResolution := 0;
//this will use more printer resolution 
Chart1.PrintResolution := 100; 

Greyscale printing

When printing to Greyscale printers you should take care that the colours of the Chart are easily distinguishable when translated to shades of grey. To help, you could add Brush styles to the Chart Series to more easily distinguish Series when printed.


Extended Printing methods

PrintPartial

Use the PrintPartial method to Print a Chart to a Printer with Control over the dimensions and location on the printed page. PrintPartial doesn't expel the page thus allowing you to print multiple Charts per page. You need to call Delphi's BeginDoc and EndDoc methods to open and close the Printer.

Example
 //Add the Printer unit to the Uses section of your project
 Printer.BeginDoc;
 Chart1.PrintPartial(Rect(0,0,500,300));
 Chart2.PrintPartial(Rect(0,400,900,700));
 Printer.EndDoc;



© 1998 teeMach SL. All rights reserved.