Hi,
I use TeePreviewPanel and add there multiple charts for printing.
Imagin a bundle of sheets, every has from 4 to 10 small chart windows on itsself.
Everything works fine - except the titles of the charts.
This is what I try (I only write the crucial lines):
I edit my (subchart)
Chart1.Title.Alignment:=.... something.
Then I add the chart by
TeePreviewPanel1.Panels.Add(Chart1);
The formatting of Chart1.Title does something, but not the wanted thing.
e.g. I set it to "taRightJustify".
Something changes, like the titel moves slightly more to the right side.
But this is not "justified".
I watched those title formatting dependent from the count of charts I add side by side.
E.g. if they look acceptable after having added 4 in a row,....
.... then, the ones on the next sheet of 3 in a row experiences a shift and partly-scroll-out-of-sight of the titles.
I found, that there is a "rect" in connection with titles. But I could not find a way with them.
Somebody has some codesnippets for me?
Maybe I have to calculate the position somehow.
Thanks,
Cheryll
TeePreviewPanel // Print Titles
TeePreviewPanel // Print Titles
Cheryll
Re: TeePreviewPanel // Print Titles
Hi Cheryll,
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TeePreviewPanel // Print Titles
I try to copy from the code lines which I use:
function ChartUmformen
.....
Chart_.Title.Alignment:=taRightJustify;
Chart_.PrintProportional:=false;
.......
=========================
if C2 <> nil then begin // das 2. Chart der obersten Reihe
ChartUmformen(C2, 1); // setzt Titel uam.
C2.PrintMargins:=Rect(Chartbreite,0,Chartbreite*3,mitte);
TeePreviewPanel_Druck.Panels.Add(C2); // Charts werden dem Druck Panel zuweisen
end;
if C3 <> nil then begin
ChartUmformen(C3, 1);
C3.PrintMargins:=Rect(Chartbreite*2,0,Chartbreite*2,mitte);
TeePreviewPanel_Druck.Panels.Add(C3);
end;
if C4 <> nil then begin
ChartUmformen(C4, 1);
C4.PrintMargins:=Rect(Chartbreite*3,0,Chartbreite,mitte);
TeePreviewPanel_Druck.Panels.Add(C4);
end;
.......
function ChartUmformen
.....
Chart_.Title.Alignment:=taRightJustify;
Chart_.PrintProportional:=false;
.......
=========================
if C2 <> nil then begin // das 2. Chart der obersten Reihe
ChartUmformen(C2, 1); // setzt Titel uam.
C2.PrintMargins:=Rect(Chartbreite,0,Chartbreite*3,mitte);
TeePreviewPanel_Druck.Panels.Add(C2); // Charts werden dem Druck Panel zuweisen
end;
if C3 <> nil then begin
ChartUmformen(C3, 1);
C3.PrintMargins:=Rect(Chartbreite*2,0,Chartbreite*2,mitte);
TeePreviewPanel_Druck.Panels.Add(C3);
end;
if C4 <> nil then begin
ChartUmformen(C4, 1);
C4.PrintMargins:=Rect(Chartbreite*3,0,Chartbreite,mitte);
TeePreviewPanel_Druck.Panels.Add(C4);
end;
.......
Cheryll
Re: TeePreviewPanel // Print Titles
PS:
mitte:=55; // = middle or my preview
Chartbreite:=20; // = width of the single chart
mitte:=55; // = middle or my preview
Chartbreite:=20; // = width of the single chart
Cheryll
Re: TeePreviewPanel // Print Titles
Hi Cheryll,
Thanks for the snippets but we'd need to reproduce the problem in a simple project here to fully understand the situation and configuration.
Besides to the simple example project, please tell us what exact TeeChart and IDE versions are you using.
Thanks in advance.
Thanks for the snippets but we'd need to reproduce the problem in a simple project here to fully understand the situation and configuration.
Besides to the simple example project, please tell us what exact TeeChart and IDE versions are you using.
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TeePreviewPanel // Print Titles
This really is much work, as my code and units are nested and linked to a DB.
I cannot provide you with my DB and creating something similar, takes at least one day as I am not familiar with it.
Do you think, you have just some code snippets, how to use this rect-property of the header?
Or some code-snippets how to fill in the headers in printpreview with multiple charts?
Or how to put a text-output window on a PrintPreview.
Anything would to it.
Thanks,
Cheryll
I cannot provide you with my DB and creating something similar, takes at least one day as I am not familiar with it.
Do you think, you have just some code snippets, how to use this rect-property of the header?
Or some code-snippets how to fill in the headers in printpreview with multiple charts?
Or how to put a text-output window on a PrintPreview.
Anything would to it.
Thanks,
Cheryll
Cheryll
Re: TeePreviewPanel // Print Titles
Hello Cheryll,
In this case, I'm not sure if I have to create an application with 4 charts, 10 charts, one chart with 4 subcharts or one chart with 10 subcharts.
Then, I understand I have to set the titles to taRightJustify, but I'm not sure to understand what's the expected result. You wrote:
Do you want to move the title to a side or the contrary depending on the values in the series? How exactly?
A bit more on Titles:
http://wiki.teechart.net/index.php?titl ... ial2#Title
I'm not sure if between the info above you'll find the tip you are looking for.
Other examples and references:
http://www.teechart.net/support/viewtop ... 21&p=44964
http://www.teechart.net/support/viewtop ... 22&p=37760
Don't take me wrong but, when we ask customers for a "simple example project we can run as-is to reproduce the problem here", we are not asking customers to take their applications and remove some code so we can run them here. We mean a new simple project, from scratch. The intention of this is to make things easer and clearer for both sides.Chartist wrote:This really is much work, as my code and units are nested and linked to a DB.
I cannot provide you with my DB and creating something similar, takes at least one day as I am not familiar with it.
In this case, I'm not sure if I have to create an application with 4 charts, 10 charts, one chart with 4 subcharts or one chart with 10 subcharts.
Then, I understand I have to set the titles to taRightJustify, but I'm not sure to understand what's the expected result. You wrote:
I don't understand what have you watched.Chartist wrote:I watched those title formatting dependent from the count of charts I add side by side.
E.g. if they look acceptable after having added 4 in a row,....
.... then, the ones on the next sheet of 3 in a row experiences a shift and partly-scroll-out-of-sight of the titles.
Do you want to move the title to a side or the contrary depending on the values in the series? How exactly?
The Titles are members of the TChartTitle class, that inherits from TStringsShape~TTextShape~TTeeCustomShapePosition~TCustomTextShape~TTeeCustomShape~TTeeCustomShapeBrushPen~TPersistent~TObjectChartist wrote:I found, that there is a "rect" in connection with titles. But I could not find a way with them.
A bit more on Titles:
http://wiki.teechart.net/index.php?titl ... ial2#Title
Here you have an example of how to use the ShapeBounds property in the Title:Chartist wrote:Do you think, you have just some code snippets, how to use this rect-property of the header?
Or some code-snippets how to fill in the headers in printpreview with multiple charts?
Or how to put a text-output window on a PrintPreview.
Code: Select all
uses Series, TeCanvas;
procedure TForm1.FormCreate(Sender: TObject);
begin
with Chart1.Title do
begin
Text.Text:='This is a testing title';
Transparent:=false;
end;
end;
procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
with Chart1.Canvas do
begin
Pen.Color:=clRed;
Brush.Style:=bsClear;
Rectangle(Chart1.Title.ShapeBounds);
end;
end;
Other examples and references:
http://www.teechart.net/support/viewtop ... 21&p=44964
http://www.teechart.net/support/viewtop ... 22&p=37760
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TeePreviewPanel // Print Titles
Hi Yearay,
yes!!!
This works perfectly for me on all my charts independent of their scale.
My code never would have worked.
I failed to use canvas as base and did not set transparency to false.
Thank you so much!
Cheryll
yes!!!
This works perfectly for me on all my charts independent of their scale.
My code never would have worked.
I failed to use canvas as base and did not set transparency to false.
Thank you so much!
Cheryll
Cheryll