Legend Position Offset

TeeChart for ActiveX, COM and ASP
Post Reply
DaveB
Newbie
Newbie
Posts: 14
Joined: Thu May 08, 2003 4:00 am
Location: Rochester , NY
Contact:

Legend Position Offset

Post by DaveB » Wed Jan 21, 2004 7:24 am

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?

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jan 21, 2004 9:36 am

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);

DaveB
Newbie
Newbie
Posts: 14
Joined: Thu May 08, 2003 4:00 am
Location: Rochester , NY
Contact:

Closed

Post by DaveB » Wed Jan 21, 2004 1:13 pm

Thank you.

Post Reply