TeeChart Dialogs (Editor, Print Preview,...)
Q: How can I show the TeeChart editor dialog and print preview at run-time ?
Uses TeePrevi; ChartPreview(Self,Chart1 ); Uses EditChar; EditChart(Self,Chart1 ); #include <TeePrevi.hpp> ChartPreview(this,Chart1 ); #include <EditChar.hpp> EditChart(this,Chart1 );(if you use DBChart components) Uses DBEditCh; EditChart(Self,DBChart1 ); #include <DBEditCh.hpp> EditChart(this,DBChart1 ); If you use any of the
"Extended" series or functions, Uses EditPro, EditChar; #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
Uses EditPro; #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. Uses Teexport; begin with TTeeExportForm.Create(Self) do try ExportPanel:=Chart1; ShowModal(); finally Free(); end; end; #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: Chart1.PrintProportional:=false; Chart1.PrintMargins:=Rect(8,8,8,8); ChartPreviewer1.Options:=ChartPreviewer1.Options-[cpoProportional]; ChartPreviewer1.Execute; |