TeeChart Dialogs (Editor, Print Preview,...)


Q: How can I show the TeeChart editor dialog and print preview at run-time ?


This code shows the editor and the print preview dialogs

DELPHI CODE : .

Uses TeePrevi;
ChartPreview(Self,Chart1 );

Uses EditChar;
EditChart(Self,Chart1 );

CBUILDER CODE : 

#include <TeePrevi.hpp>
ChartPreview(this,Chart1 );
#include <EditChar.hpp>
EditChart(this,Chart1 );

(if you use DBChart components)

DELPHI CODE : 

Uses DBEditCh;
EditChart(Self,DBChart1 );

CBUILDER CODE : 

#include <DBEditCh.hpp>
EditChart(this,DBChart1 );

If you use any of the "Extended" series or functions,
add EditPro unit to your "Uses".

DELPHI CODE : 

Uses EditPro, EditChar;

CBUILDER CODE : 

#include <EditPro.hpp>
#include <EditChar.hpp>

Q: I don't see the extended Series types at the Chart gallery when showing it at run-time


use the "EditPro" unit in your project.

DELPHI CODE : 

Uses EditPro;

CBUILDER CODE : 

#include <EditPro.hpp>

Q: How do I bring up the Export dialog form?

You must include the TeePrevi.pas unit in the Uses clause. The code bellow will display Export form for Chart1.

DELPHI CODE : 

Uses Teexport;
begin
  with TTeeExportForm.Create(Self) do
  try
    ExportPanel:=Chart1;
    ShowModal();
  finally
    Free();
  end;
end;

CBUILDER CODE : 

#include <Teexport.hpp>


  TTeeExportForm *tmp=new TTeeExportForm(this);
  try
  {
    tmp->ExportPanel=Chart1;
    tmp->ShowModal();
  }
  __finally
  {
    delete tmp;
  }

Q:When I pull out that ChartPreview dialog, the proportional is always checked and the print margins are already set. How can I change this ?

There is a bug in the TeeChart previewer. It does not respect the Chart PrintMargins property i.e. if you set the Chart1.PrintMargins:=Rect(8,8,8,8) and the Chart.PrintProportional:=false; then this setting will not be respected. The workaround is to use the code bellow. This code will disable the PrintProportional and set the specific print margins:


DELPHI CODE : 

Chart1.PrintProportional:=false;
Chart1.PrintMargins:=Rect(8,8,8,8);
ChartPreviewer1.Options:=ChartPreviewer1.Options-[cpoProportional];
ChartPreviewer1.Execute;