Cannot calc Y position and marks positions

TeeChart for ActiveX, COM and ASP
Post Reply
Mont
Newbie
Newbie
Posts: 9
Joined: Tue Aug 17, 2004 4:00 am

Cannot calc Y position and marks positions

Post by Mont » Fri Nov 19, 2004 9:37 am

Having a bit of a weird one where the bar marks are not correctly positioned above bars i.e. they are overlapping.

so.. i'm trying to run this bit of code to move them:

BarTop = .Series(1).CalcYPos(i)
BarBottom = .Series(1).CalcYPosValue(i)
ypos = (BarTop + BarBottom) / 2
.Series(1).Marks.Positions.Position(i).Custom = True
.Series(1).Marks.Positions.Position(i).LeftTop.Y = ypos

i'm looping through a recordset, incrementing 'i' through each loop.

BarTop and BarBottom = "0" and the code fails on .Series(1).Marks.Positions.Position(i)....

i've replaced (i) with 1,2 etc and I still get the same.

Is it something simple that i've done wrong?

Thanks

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

Post by Pep » Mon Nov 22, 2004 7:41 am

Hi,

the following code works fine :

Code: Select all

Private Sub Form_Load()
With TChart1
    .Aspect.View3D = False
    .AddSeries scBar
    .Series(0).FillSampleValues (5)
    .Series(0).Marks.Visible = True
    .Series(0).Marks.Arrow.Visible = False
    .Environment.InternalRepaint
    For i = 0 To .Series(0).Count - 1
        BarTop = .Series(0).CalcYPos(i)
        BarBottom = .Series(0).CalcYPosValue(i)
        ypos = (BarTop + BarBottom) / 2
        .Series(0).Marks.Positions.Position(i).Custom = True
        .Series(0).Marks.Positions.Position(i).LeftTop.Y = ypos
    Next i
End With
End Sub

Post Reply