Printer.Margins.Right being ignored

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Avatar
Newbie
Newbie
Posts: 26
Joined: Mon Mar 22, 2004 5:00 am
Location: Calgary Canada
Contact:

Printer.Margins.Right being ignored

Post by Avatar » Tue May 31, 2005 3:23 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 31, 2005 4:07 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Avatar
Newbie
Newbie
Posts: 26
Joined: Mon Mar 22, 2004 5:00 am
Location: Calgary Canada
Contact:

Post by Avatar » Tue May 31, 2005 9:21 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jun 01, 2005 9:22 am

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:

Code: Select all

line1.CustomVertAxis = axis1;
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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Avatar
Newbie
Newbie
Posts: 26
Joined: Mon Mar 22, 2004 5:00 am
Location: Calgary Canada
Contact:

Post by Avatar » Wed Jun 01, 2005 3:02 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jun 02, 2005 8:24 am

Hi Avatar,

Thank you very much for your example project.

Adding:

Code: Select all

        TChart1.Panel.MarginUnits = Steema.TeeChart.PanelMarginUnits.Pixels
        TChart1.Panel.MarginRight = 65
To your Form_Load event will make your custom axis being visible.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Avatar
Newbie
Newbie
Posts: 26
Joined: Mon Mar 22, 2004 5:00 am
Location: Calgary Canada
Contact:

Post by Avatar » Thu Jun 02, 2005 1:33 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jun 02, 2005 2:11 pm

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:

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Avatar
Newbie
Newbie
Posts: 26
Joined: Mon Mar 22, 2004 5:00 am
Location: Calgary Canada
Contact:

Post by Avatar » Thu Jun 02, 2005 4:14 pm

Hi Narcís,

I got the email thanks. Can I paste a CS Class in a VB form? I can make out some of it but I may not be able to translate all of it. I am about a month away from finishing my app will the new release be avalable by then (ballpark ish)? I am also waiting on other fixes.

Thanks

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jun 03, 2005 8:42 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply