Problems when showing labels in marks

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Albert
Newbie
Newbie
Posts: 16
Joined: Fri Nov 15, 2002 12:00 am
Location: Taipei, Taiwan, Republic of China
Contact:

Problems when showing labels in marks

Post by Albert » Fri Jul 23, 2004 9:59 am

I had tried to show labels of points in marks, but there is a problem.
Here is part of my code:

Dim PosX,PosY as Double
Dim Labels as String
...
Point1.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Label
...
<For Loop>
Point1.add(PosX,PosY,Labels)
...

I added a lot of points, but some points' marks showed the Y values instead of the labels.

How can I make all points show their "label" in marks.

Thanks in advance.

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

Post by Pep » Fri Jul 23, 2004 5:34 pm

Hi Albert,

it works fine using the latest build available for download on our web site, at the private customers download page. Could you please post the code you're using so I can reproduce the problem here ?

Albert
Newbie
Newbie
Posts: 16
Joined: Fri Nov 15, 2002 12:00 am
Location: Taipei, Taiwan, Republic of China
Contact:

Post by Albert » Mon Jul 26, 2004 1:52 am

Hi Pep, here is my function code:

Private Function ShowPoints(ByRef DT As DataTable, ByVal SysName As String)

Dim Rows As DataRow()
Dim PR As DataRow()
Dim i As New Integer
Rows = DT.Select("SysName='" + SysName + "'")

For i = 0 To Rows.Length - 1
If CStr(Rows(i).Item("Flag"))=1 < 0 Then
PR = ProDS.Tables("WTP").Select("PointID='" + Rows(i).Item("ChildredID") + "'")
If PR.Length <> 0 Then
WTPPoint.Add(PR(0).Item("PosX"), PR(0).Item("PosY"),PR(0).Item("PointName"))
End If
End If
Next

End Function

'------------------------------------------------------------------------------
'DT table contains 2 rows : 'SysName', 'ChildrenID'
'ProDS.Tables('WTP') table contains 4 rows : 'PointID','PointName', 'PosX', 'PosY'
'where those data is fetched from my database
'And the SysName and PointName are Chinese

Albert
Newbie
Newbie
Posts: 16
Joined: Fri Nov 15, 2002 12:00 am
Location: Taipei, Taiwan, Republic of China
Contact:

Post by Albert » Mon Jul 26, 2004 2:31 am

Hi, Pep

I try to use the event handler: TChart_ClickSeries to find out the label.
The points' labels are empty when the points show Y values instead of labels.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Tue Jul 27, 2004 12:25 pm

Hi Albert,
How can I make all points show their "label" in marks.
Does the following code work at your end?

Code: Select all

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim i As Integer
        For i = 0 To 10
            Line1.Add(i, Rnd() * 100, Chr(65 + i))
        Next
        Line1.Marks.Visible = True
        Line1.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Label
    End Sub
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Albert
Newbie
Newbie
Posts: 16
Joined: Fri Nov 15, 2002 12:00 am
Location: Taipei, Taiwan, Republic of China
Contact:

Post by Albert » Wed Jul 28, 2004 4:33 am

Hi, Chris

It does work.

But the problem is still there when I use my own code.

Albert
Newbie
Newbie
Posts: 16
Joined: Fri Nov 15, 2002 12:00 am
Location: Taipei, Taiwan, Republic of China
Contact:

Post by Albert » Wed Jul 28, 2004 5:34 am

Hi, Chris

Please try this code:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer
Dim SX(6) As Double
Dim SY(6) As Double
Dim SN(6) As String
SX(0) = 19.2
SY(0) = 67.5
SX(1) = 38.6
SY(1) = 69.5
SX(2) = 64.5
SY(2) = 68.5
SX(3) = 84
SY(3) = 63
SX(4) = 26
SY(4) = 14
SX(5) = 53
SY(5) = 19
SX(6) = 79.5
SY(6) = 15.5
SN(0) = "SN0"
SN(1) = "SN1"
SN(2) = "SN2"
SN(3) = "SN3"
SN(4) = "SN4"
SN(5) = "SN5"
SN(6) = "SN6"
For i = 0 To 6
Points1.Add(SX(i), SY(i), SN(i))
Next
Points1.Marks.Visible = True
Points1.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Label
End Sub


Best Regards

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

Post by Pep » Wed Jul 28, 2004 7:27 am

Hi Albert,

yes, you're correct, it seems to be a bug. I've added on our defect list to be reviewed and fixed for the next maintenance releases.

Post Reply