Page 1 of 1

Legend Position Offset

Posted: Wed Jan 21, 2004 7:24 am
by 9078528
I am trying to adjust the legend property "Position Offset %", which is available in the Teechart property editor as: Chart/Legend/Position/Position Offset %, from within a VC application using the CLegend wrapper class generated by Visual Studio 6.

I believe that the function I need is SetHorizMargin() but this does not have any effect.

Basically, I want to set the legend to top, center. Currently, it gets set to top but has a right offset of 10% when I use the following code:

Code: Select all

m_wndChart.GetLegend().SetAlignment(laTop);
m_wndChart.GetLegend().SetHorizMargin(0);
I'm using Teechart 6.0.0.4. Can someone point me in the right direction?

Posted: Wed Jan 21, 2004 9:36 am
by Pep
From the TeeChart Help :

property HorizMargin: Integer;

"It's only used when Legend position is Left or Right aligned otherwise use Verticalmargin."

So you must use another property, in that case the "TopPos" :

Code: Select all

m_wndChart.GetLegend().SetTopPos(0);

Closed

Posted: Wed Jan 21, 2004 1:13 pm
by 9078528
Thank you.