Center the label in a Symbol

TeeChart for ActiveX, COM and ASP
Post Reply
BigMike
Newbie
Newbie
Posts: 13
Joined: Mon Oct 15, 2001 4:00 am
Location: Irvine CA
Contact:

Center the label in a Symbol

Post by BigMike » Wed Oct 13, 2004 4:16 pm

Hey Guys,

I'm building a Bubble chart, my labels are simple numbers 1, 2, 3, etc. they are showing up in the top of the symbol / bubble, is there a way to center the numbers?

No is an acceptable answer :D

Here is the code I'm using, i is the number / label.

Code: Select all

adoRs.MoveFirst 
Do Until adoRs.EOF 
With QuadrantChart.Series(1).asBubble 
.AddBubble adoRs.Fields(3).Value, adoRs.Fields(2).Value, 1.5, i, RGB(ChartColorRed(i), ChartColorGreen(i), ChartColorBlue(i)) 
i = i + 1 
adoRs.MoveNext 
End With 
Loop]
[/code]

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

Post by Pep » Wed Oct 13, 2004 10:04 pm

Hi Mike,
the top of the symbol / bubble, is there a way to center the numbers?
Yes, you can use the following code :

Code: Select all

Private Sub Form_Load()
With TChart1
    .AddSeries scBubble
    .Series(0).FillSampleValues (5)
    .Series(0).Marks.Visible = True
    .Aspect.View3D = False
    .Environment.InternalRepaint
    For i = 0 To .Series(0).Count - 1
        .Series(0).Marks.Positions.Position(i).Custom = True
        .Series(0).Marks.Positions.Position(i).LeftTop.Y = TChart1.Series(0).CalcYPosValue(TChart1.Series(0).YValues.Value(i)) - (.Canvas.TextHeight("H") / 2)
    Next i
End With
End Sub

Post Reply