Difference between revisions of "FMXTutorial14"

From Steema Software Reference Wiki
Jump to: navigation, search
Line 9: Line 9:
 
| width="20" |
 
| width="20" |
 
|}
 
|}
 
+
{{DISPLAYTITLE:<span style="position: absolute; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px);">{{FULLPAGENAME}}</span>}}
 +
= Tutorial 14 - Printing Charts =
 
__TOC__
 
__TOC__
 
<br>
 
<br>
 
+
== Standard Printing ==
== Tutorial 14 - Printing Charts ==
+
 
+
 
+
=== Standard Printing ===
+
  
 
TeeChart Pro offers standard print methods to print the Onscreen Chart 'as is' to the Printer.
 
TeeChart Pro offers standard print methods to print the Onscreen Chart 'as is' to the Printer.
  
==== Simple Print command ====
+
=== Simple Print command ===
  
 
To print a Chart use the '''Print''' method. This will print the chart as it appears onscreen.
 
To print a Chart use the '''Print''' method. This will print the chart as it appears onscreen.
Line 31: Line 28:
 
<br />
 
<br />
  
==== Print Orientation ====
+
=== 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 for you. You must run Print after changing the PrintOrientation.
 
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 for you. You must run Print after changing the PrintOrientation.
Line 46: Line 43:
 
<br />
 
<br />
  
==== Print Preview ====
+
=== 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:
 
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:
Line 56: Line 53:
 
<br />
 
<br />
  
==== Print Resolution ====
+
=== 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%.
 
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%.
Line 69: Line 66:
 
<br />
 
<br />
  
==== Greyscale printing ====
+
=== 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.
 
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.
Line 75: Line 72:
 
<br />
 
<br />
  
=== Extended Printing methods ===
+
== Extended Printing methods ==
  
==== PrintPartial ====
+
=== 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.
 
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.
Line 90: Line 87:
 
   Printer.EndDoc;
 
   Printer.EndDoc;
  
==== Printing multiple page Charts ====
+
=== Printing multiple page Charts ===
  
 
For information about printing multipage Charts (where MaxPointsPerPage is less than the total point quntity) please see the [[Tutorial3 | Chart paging tutorial.]]
 
For information about printing multipage Charts (where MaxPointsPerPage is less than the total point quntity) please see the [[Tutorial3 | Chart paging tutorial.]]
Line 96: Line 93:
 
<br />
 
<br />
  
==== Print previewing several Charts on one page ====
+
=== Print previewing several Charts on one page ===
  
 
The Print Preview panel now accepts more than one Chart (or TeePanel). Chart positions are controlled setting the PrintMargins property. Use the TeePreviewPanel1.Panels collection to manage the Charts on the Preview page.
 
The Print Preview panel now accepts more than one Chart (or TeePanel). Chart positions are controlled setting the PrintMargins property. Use the TeePreviewPanel1.Panels collection to manage the Charts on the Preview page.

Revision as of 14:21, 10 October 2014

Tchfmx.jpg

Contents page
Previous | Next

Tutorial 14 - Printing Charts


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 for 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;

Printing multiple page Charts

For information about printing multipage Charts (where MaxPointsPerPage is less than the total point quntity) please see the Chart paging tutorial.


Print previewing several Charts on one page

The Print Preview panel now accepts more than one Chart (or TeePanel). Chart positions are controlled setting the PrintMargins property. Use the TeePreviewPanel1.Panels collection to manage the Charts on the Preview page.


  { change margins }
  Chart1.PrintProportional:=False;
  Chart2.PrintProportional:=False;

  Chart1.PrintMargins:=Rect(2,2,60,60);
  Chart2.PrintMargins:=Rect(60,60,2,2);

  { add to preview }
  TeePreviewPanel1.Panels.Add(Chart1);
  TeePreviewPanel1.Panels.Add(Chart2);

Only one Chart may be mousedrag moved on the Previewer at one viewing so you must disable the 1st Chart from view to enable drag repositioning of the 2nd Chart. The TeeChart demo project includes a page with the following code:


  With TeePreviewPanel1 do
  begin
    Panels.Clear;
    if CheckBox1.Checked then Panels.Add(Chart1);
    if CheckBox2.Checked then Panels.Add(Chart2);
    Repaint;
  end;

By selecting one or another of the 2 Checkboxes (when both are showing only the first Chart is moveable) you may reposition both the Charts on the page via mousedrag.



PREVIOUS

NEXT


© 1998-2014 Steema Software SL. All rights reserved.