Jump to content
Software FX Community

Re: Legend box problem


User (Legacy)

Recommended Posts

Hi Steve,

I found a solution, too. I use the ScaleMode Property of VB.

Dim OldScaleMode As Integer

With cfx.LegendBoxObj

...(code omitted)

OldScaleMode = Me.ScaleMode

Me.ScaleMode = vbPixels

.Left = cfx.Width - .Width - 8

.Top = cfx.Height / 2 - .Height / 2

Me.ScaleMode = OldScaleMode

End With

However, thanks for your help.

Regards,

Bernd

SteveT wrote:

>

> Bernd,

>

> I have always used ValueToPixel to gain the interior coordinates. Not exactly what you are trying to acomplish.

>

> Dim dblX As Double

> Dim dblY As Double

> Dim nReturn As Variant

> Dim lngPixelX As Long

> Dim lngPixelY As Long

>

> With .LegendBoxObj

> .Visible = True

> .Moveable = False

> .BorderStyle = BBS_FLAT

> .Docked = TGFP_FIXED

> .SizeToFit

>

> 'locate legend

> dblX = Me.ChartFX1.NValues

> dblY = Me.ChartFX1.Axis(AXIS_Y).Max / 2

> nReturn = Me.ChartFX1.ValueToPixel(dblX, dblY, lngPixelX, lngPixelY, AXIS_Y)

>

> .Top = lngPixelY - .Height / 2 - 8

> .Left = lngPixelX - .Width - 8

>

> End With

>

> Steve

>

> Bernd Hoffmann <Bernd.Hoffmann@insocam.de> wrote in message news:3A191D2E.51090933@insocam.de...

> > Hi there,

> >

> > I tried to use the CFX-code sample for centering the series legend box on the

> > value legend box:

> >

> > With cfx.LegendBoxObj

> > .Moveable = False

> > .BorderStyle = BBS_FLAT

> > .Docked = TGFP_FIXED

> > .SizeToFit

> > 'Center vertically

> > .Left = cfx.Width - .Width - 8

> > .Top = cfx.Height / 2 - .Height / 2

> > cfx.RightGap = .Width + 8

> > End With

> >

> > The size of my chart control is 7695 x 7335 so that the left position of the

> > legend box should be at 7620 and the top position at 3644.

> > When using this code the legend box disappears (for the SerLegBoxObj it works

> > fine).

> >

> > When using own values for left and top I end up at about 435 for left and 35

> > for top to 'center' the legend box.

> >

> > Is it possible that the internal coordinate system of the chart fx control is

> > wrong for the legend box?

> >

> > Any help will be greatly appreciated.

> >

> > Regards,

> > Bernd

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...