Page 1 of 1

Legend Positioning with custom vertical axes?

Posted: Tue Jul 22, 2008 2:58 pm
by 14045609
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

Posted: Tue Jul 22, 2008 3:12 pm
by narcis
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!

Posted: Tue Jul 22, 2008 6:52 pm
by 14045609
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.