Jump to content
Software FX Community

Re: Legend box problem


User (Legacy)
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...