Printer.Margins.Right being ignored
Printer.Margins.Right being ignored
Hi Teechart
My Chart has 6 axis’s 3 on the right and three on the left. The farthest right position is set to -30 Other side. When I go to print part of the far right axis gets cut off. No matter what size I set ‘Printer.Margins.Right’ I get the same plot. If I preview the plot ‘Printer.Margins.Right’ works in the preview but not on the plot.
Is there something else I have to turn off or on?
With
TChartz.Printer.BeginPrint()
TChartz.Printer.Print(New Rectangle(0, 0, 1050, 800))
TChartz.Printer.EndPrint()
I can get close and I can build something to add the margins in, but then I don’t think it will work if the paper is metric.
Thanks
My Chart has 6 axis’s 3 on the right and three on the left. The farthest right position is set to -30 Other side. When I go to print part of the far right axis gets cut off. No matter what size I set ‘Printer.Margins.Right’ I get the same plot. If I preview the plot ‘Printer.Margins.Right’ works in the preview but not on the plot.
Is there something else I have to turn off or on?
With
TChartz.Printer.BeginPrint()
TChartz.Printer.Print(New Rectangle(0, 0, 1050, 800))
TChartz.Printer.EndPrint()
I can get close and I can build something to add the margins in, but then I don’t think it will work if the paper is metric.
Thanks
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Avatar,
It works fine here provided the problematic axis is visible on the application form and printing sizes fit on the paper.
If the axis is not visible at your application form then you should set TChart panel margins to fit the axis in the chart rectangle.
If you are still experiencing problems please send us an example application we can run "as-is" to reproduce the problem here. You can post your examples at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
It works fine here provided the problematic axis is visible on the application form and printing sizes fit on the paper.
If the axis is not visible at your application form then you should set TChart panel margins to fit the axis in the chart rectangle.
If you are still experiencing problems please send us an example application we can run "as-is" to reproduce the problem here. You can post your examples at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
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 |
Hi Narcís
All of the axis were set to visible. I have been trying different things.
I create a new project. Place an instance of TeeChart on it and Dock it to all sides. I add one line series non 3D. I add a Custom axis Other Side = true Position = -30 in pixels. The axis is visible. I make the legend.visable = false. And the Custom axis is also gone.
If I set TChart1.Panel.MarginRight = 60 in Form1_Load the axis is back. Right Print margins do not work at any setting.
If I have a visible Legend on the right side the print margin appears to work from the right side of the legend. My application has no legend so none of the right asix’s are in view. The panel is crowded to the far right.
Thanks
All of the axis were set to visible. I have been trying different things.
I create a new project. Place an instance of TeeChart on it and Dock it to all sides. I add one line series non 3D. I add a Custom axis Other Side = true Position = -30 in pixels. The axis is visible. I make the legend.visable = false. And the Custom axis is also gone.
If I set TChart1.Panel.MarginRight = 60 in Form1_Load the axis is back. Right Print margins do not work at any setting.
If I have a visible Legend on the right side the print margin appears to work from the right side of the legend. My application has no legend so none of the right asix’s are in view. The panel is crowded to the far right.
Thanks
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Avatar,
It works fine here if the custom axis appears on the chart panel at design-time and it is asigned to the series, have you already done that? You should do:
At design-time, using the chart editor at Series -> General -> Vertical Axis, doesn't work, this is a bug already listed in our defect list to be fixed for future releases.
If you are still having problems please send us an example aplication we can run "as-is" to reproduce your problem here and help you overcome this. You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
It works fine here if the custom axis appears on the chart panel at design-time and it is asigned to the series, have you already done that? You should do:
Code: Select all
line1.CustomVertAxis = axis1;
If you are still having problems please send us an example aplication we can run "as-is" to reproduce your problem here and help you overcome this. You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
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 |
Hi Narcís
Yes I did that. I have sent file to News://www.steema.net/steema.public.attachments
called 'PrintMargins'
If legend is visable = false the right axis will not display in either the design-time or run time.
Thanks
Yes I did that. I have sent file to News://www.steema.net/steema.public.attachments
called 'PrintMargins'
If legend is visable = false the right axis will not display in either the design-time or run time.
Thanks
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Avatar,
Thank you very much for your example project.
Adding:
To your Form_Load event will make your custom axis being visible.
Thank you very much for your example project.
Adding:
Code: Select all
TChart1.Panel.MarginUnits = Steema.TeeChart.PanelMarginUnits.Pixels
TChart1.Panel.MarginRight = 65
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 |
Hi Narcís,
Yes, that was done in the original app. The version I sent you was to step you through what I am seeing.
Now in the version you have
TChart1.Panel.MarginUnits = Steema.TeeChart.PanelMarginUnits.Pixels
TChart1.Panel.MarginRight = 65
TChart1.Printer.Margins.Right = 100
And Print it.
Print preview has a right margin of 165 the panel print margin and the print right margin.
Print however ignores the right margin an I get just Panel.MarginRight of 65
This was the original question.
I can work around it in my print command because I can add the two to Panel.MarginRight just before the print statement and the switch it back after.
In print preview increasing the right margin does nothing. And I can’t see how to interrupt the print button.
Thanks
Yes, that was done in the original app. The version I sent you was to step you through what I am seeing.
Now in the version you have
TChart1.Panel.MarginUnits = Steema.TeeChart.PanelMarginUnits.Pixels
TChart1.Panel.MarginRight = 65
TChart1.Printer.Margins.Right = 100
And Print it.
Print preview has a right margin of 165 the panel print margin and the print right margin.
Print however ignores the right margin an I get just Panel.MarginRight of 65
This was the original question.
I can work around it in my print command because I can add the two to Panel.MarginRight just before the print statement and the switch it back after.
In print preview increasing the right margin does nothing. And I can’t see how to interrupt the print button.
Thanks
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Avatar,
Thank you very much for your feedback.
Yes, you are right. However it has already been fixed for the next release.
In the meantime, we have encapsulated some of TeeChart’s printing functionality into a class called MyPrinter, which I'm going to send you by e-mail. You can use this class in the following manner:
As you can see from the code in this class, using the public void Print(Chart c, Rectangle r) overload, MyPrinter will print a chart to the specified rectangle, but will clip the rectangle to the size of the paper if the chart is too big. Using the public void Print(Chart c, Point r) overload, MyPrinter will print the top left corner of the chart to the specified point and will calculate the chart size based on the paper size.
Thank you very much for your feedback.
Yes, you are right. However it has already been fixed for the next release.
In the meantime, we have encapsulated some of TeeChart’s printing functionality into a class called MyPrinter, which I'm going to send you by e-mail. You can use this class in the following manner:
Code: Select all
private void button2_Click(object sender, System.EventArgs e)
{
tChart1.Width = 3090;
MyPrinter letsPrint = new MyPrinter();
//letsPrint.Print(tChart1.Chart, new Rectangle(200,200,200,200));
letsPrint.Print(tChart1.Chart, new Point(10,10));
}
As you can see from the code in this class, using the public void Print(Chart c, Rectangle r) overload, MyPrinter will print a chart to the specified rectangle, but will clip the rectangle to the size of the paper if the chart is too big. Using the public void Print(Chart c, Point r) overload, MyPrinter will print the top left corner of the chart to the specified point and will calculate the chart size based on the paper size.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Avatar,
I'm afraid not, I'd suggest you to use this website to convert C# code to VB.NET code.
Regarding next release, TeeChart for .NET next maintenance release and TeeChart for .NET v2 are expected to be released before the end of next week.
I'm afraid not, I'd suggest you to use this website to convert C# code to VB.NET code.
Regarding next release, TeeChart for .NET next maintenance release and TeeChart for .NET v2 are expected to be released before the end of next week.
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 |