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
ChartPreviewer - change default Detail from Normal to More
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Steve,
Yes, use:
Yes, you can do this using: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 ?
Code: Select all
Chart1.PrintResolution := -100 ;
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.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 % ?
Yes, use:
Code: Select all
Chart1.PrintProportional := false;
Chart1.PrintMargins:= Rect(5, 5, 5, 5);
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
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
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
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
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
Hi Steve,
BTW, I've set the TeePrevi.pas global variable TeeChangePaperOrientation to false to avoid resetting printer orientation to poLandscape in TChartPreview.FormShow routine.
The following code worked fine:Can the printer orientation be changed from its landscape default to portrait ?
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;
How about usign the OnBeforePrint event ? Setting the modifications that you want to get :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 ?
Code: Select all
procedure TForm1.Chart1BeforePrint(Sender: TCustomTeePanel;
Canvas: TCanvas; var R: TRect);
begin
Chart1.BackWall.Color:=clblue;
end;
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.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, this is by default, you will have to set Active to false when the ChartPreviewer is called :I also note that a cursor tool on the displayed chart shows up in the Chart Previewer.
Code: Select all
ChartTool1.Active:=false;
ChartPreviewer1.Execute;
Charttool1.Active:=true;
It cannot be changed in the existing version.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.
You can do :Can the default ChartPreviewer window size be increased so the previewed chart would appear larger to the user ?
Code: Select all
ChartPreviewer1.WindowState:=wsMaximized;
ChartPreviewer1.Execute;
I'm afraid that there's not a way.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).
Pep Jorge
http://support.steema.com
http://support.steema.com