Hi Steve,
Can the printer orientation be changed from its landscape default to portrait ?
The following code worked fine:
Code: Select all
Uses TeePrevi,Printers;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues(10);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
TeeChangePaperOrientation := False;
Printer.Orientation := poPortrait;
ChartPreviewer1.Execute;
end;
BTW, I've set the TeePrevi.pas global variable TeeChangePaperOrientation to false to avoid resetting printer orientation to poLandscape in TChartPreview.FormShow routine.
I am displaying the chart on the computer monitor with a black BackWall.Color but wish to print it with a white BackWall.Color. I could temporarily change the BackWall.Color to white and then call ChartPreviewer, but the user would then see that color change on their monitor. Additionally, other chart properties need to be changed when printed such as axis label font size increased. What is a recommeded approach to solve this ?
How about usign the OnBeforePrint event ? Setting the modifications that you want to get :
Code: Select all
procedure TForm1.Chart1BeforePrint(Sender: TCustomTeePanel;
Canvas: TCanvas; var R: TRect);
begin
Chart1.BackWall.Color:=clblue;
end;
However, my displayed chart has its axis labels customized in OnGetAxisLabel by changing that event's LabelText property. These changed labels do not persist into the temporary chart using the Assign method. Is there a way they can be ?
Yes, they are not copied as these has been changed once the Chart is displayed, the only way I can think of is to do the modif. in the new Chart.
I also note that a cursor tool on the displayed chart shows up in the Chart Previewer.
Yes, this is by default, you will have to set Active to false when the ChartPreviewer is called :
Code: Select all
ChartTool1.Active:=false;
ChartPreviewer1.Execute;
Charttool1.Active:=true;
Also, can the size of the printer paper on which the chart to be printed is displayed be increased so that it occupies more of the ChartPreviewer's panel (the gray to white gradient panel) ? It appears to be a fixed percentage. I'd like to make the chart appear larger to the user.
It cannot be changed in the existing version.
Can the default ChartPreviewer window size be increased so the previewed chart would appear larger to the user ?
You can do :
Code: Select all
ChartPreviewer1.WindowState:=wsMaximized;
ChartPreviewer1.Execute;
Some changes on the ChartPreviewer take 5 seconds or more for the previewed chart to update (printer orientation, smooth checkbox). Can some indication be given to the user that the program is actually processing (cursor change to hourglass for example).
I'm afraid that there's not a way.