Page 1 of 1

ChartPreviewer - change default Detail from Normal to More

Posted: Mon Jun 19, 2006 8:32 pm
by 9333098
Is it possible to programmatically change the default ChartPreviewer Detail trackbar setting from Normal to More so the user sees an initial setting of More ?

Can the margins setting be changed from percent to pixels or better yet to inches ?

Also, can the default margins the programmatically set to say 5 % ?

Steve

Posted: Tue Jun 20, 2006 8:20 am
by narcis
Hi Steve,
Is it possible to programmatically change the default ChartPreviewer Detail trackbar setting from Normal to More so the user sees an initial setting of More ?
Yes, you can do this using:

Code: Select all

  Chart1.PrintResolution := -100 ;

Can the margins setting be changed from percent to pixels or better yet to inches ?
This is not possible for now, they are only be set in percent units. I'll add your request to our wish-list to be considered for future releases.
Also, can the default margins the programmatically set to say 5 % ?


Yes, use:

Code: Select all

  Chart1.PrintProportional := false;
  Chart1.PrintMargins:= Rect(5, 5, 5, 5);

Posted: Wed Jun 21, 2006 3:38 pm
by 9333098
Thanks Narcis.

Can the printer orientation be changed from its landscape default to portrait ?

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 ? I have created an invisible temporary chart at run time and Assigned it to the displayed chart. I can then change this temporary chart's properties as desired for printing.

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 ?

I also note that a cursor tool on the displayed chart shows up in the Chart Previewer.

Steve

Posted: Thu Jun 22, 2006 2:50 am
by 9333098
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.

I've tried using ChartPreviewer1.PreviewPanel.MarginUnits := muPixels;
ChartPreviewer1.PreviewPanel.MarginLeft := 10;
but this had no effect.

Can the default ChartPreviewer window size be increased so the previewed chart would appear larger to the user ?

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).

Steve

Posted: Mon Jun 26, 2006 11:05 am
by Pep
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.