Legend Positioning with custom vertical axes?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Aaron Peronto
Newbie
Newbie
Posts: 29
Joined: Wed Jun 20, 2007 12:00 am

Legend Positioning with custom vertical axes?

Post by Aaron Peronto » Tue Jul 22, 2008 2:58 pm

I wanted to see if anyone had any experience with trying to position the TeeChart embedded legend on a graph which contains multiple custom vertical axes.

We have the ability to generate a graph using 6 vertical axes. 3 on the left side and 3 of the right side.
When I try to place the TeeChart legend into the graph on either the left or the right side, the legend draws on top of the custom vertical axes.
I have looked at and tried to use many of the different properties on the legend itself to change its positioning with respect to the currently visible vertical axes but I cannot seem to get the placement correct.

Any assistance or recommendations with the placement of the legend would be greatly appreciated.

Thanks.
Aaron Peronto

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 Jul 22, 2008 3:12 pm

Hi Aaron,

Yes, you need to set the legend to a custom position as shown here. You can use axes properties, for example:

Code: Select all

			tChart1.Axes.Right.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
			tChart1.Legend.Left = tChart1.Axes.Right.Position + 30;
You may also need to set panel margins:

Code: Select all

			tChart1.Panel.MarginUnits = Steema.TeeChart.PanelMarginUnits.Pixels;
			tChart1.Panel.MarginRight = tChart1.Legend.Width + 50;
Hope this helps!
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

Aaron Peronto
Newbie
Newbie
Posts: 29
Joined: Wed Jun 20, 2007 12:00 am

Post by Aaron Peronto » Tue Jul 22, 2008 6:52 pm

Thanks as always for the quick response.

This got me started in the right direction to get my legend placed correctly.
I ended up having to use the RelativePosition property of the farthest outside axis on the side the legend was getting drawn on.

This plus a little more math to determine the margins needed seems to be working pretty well.

Thanks again.

Post Reply