Jump to content
Software FX Community

Coordinate System of annotation objects


User (Legacy)

Recommended Posts

I can't figure out this coordinate system of the annotation objects.

I want to put something in a certain spot relative to the upper left corner

of the ActiveX object.

If I try to put these text boxes here :

set r1 = AnnotX.Add(OBJECT_TYPE_TEXT)

r1.Text = "X"

r1.Top = 0

r1.Left = 75

r1.height = 15

r1.width = 100

r1.AllowModify = false

r1.AllowMove = false

r1.Font.Size = 7

r1.BkColor = Chart_Transparent

r1.Color = llForegroundColor

r1.Align = LA_RIGHT Or LA_TOP

set r1 = AnnotX.Add(OBJECT_TYPE_TEXT)

r1.Text = "Y"

r1.Top = 0

r1.Left = 175

r1.height = 15

r1.width = 100

r1.AllowModify = false

r1.AllowMove = false

r1.Font.Size = 7

r1.BkColor = Chart_Transparent

r1.Color = llForegroundColor

r1.Align = LA_LEFT Or LA_TOP

You would think that the two text boxes would be touching eachother (since

the X is right justified and the Y is left justified,

and the Y starts at where the X should end up).

But they aren't touching eachother.

This coordinate system doesn't seem to be reliable across different size

charts.

Another example of this is when I use the following code to generate

annotations

Dim iii, iiileft,iiitop

Dim jjj

For iii = 0 to 10

For jjj = 0 to 8

set r1 = AnnotX.Add(OBJECT_TYPE_TEXT)

iiileft = iii * 100

iiitop = jjj * 100

r1.Text = "(" & iiileft & "," & iiitop & ")"

r1.Top = iiitop

r1.Left = iiileft

r1.height = 100

r1.width = 100

r1.AllowModify = false

r1.AllowMove = false

r1.Font.Size = 7

r1.BkColor = Chart_Transparent

r1.Color = llForegroundColor

r1.Align = LA_LEFT Or LA_TOP

next ' jjj

next ' iii

If my chart is 253 high by 778 wide, then I can see the point labeled

"(900,800)"

but if my chart is 389 wide (and 253 high) , then I can see the point

"(1000,800)"

This definitely isn't pixels .... so is there some way to translate this

coordinate system

so I can count on the width of the chart being

measured in the same coordinates that I am placing my annotations with, and

the width

of the annotation is measured in the same coordinates as the left method?

This fits in when I have the size of my chart set to

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...