Page 1 of 1

Return value of point

Posted: Tue Aug 23, 2005 4:26 am
by 9078431
Hi,

I have one serie of data that containt this values

id days value

300 50 4
120 80 2.5
600 120 5
333 10 2
456 200 8

On Y axis is days and X axis is value.

When I clic on point 120, 5 by example, I need return 600.

Can someone help me.

Tia.

Daniel

Posted: Tue Aug 23, 2005 8:24 am
by narcis
Hi Daniel,

You can add id to the series as the point label and display it using a MarkTips tool. The following code does exactly what you request:

Code: Select all

Private Sub Form_Load()
    With TChart1.Series(0)
        .AddXY 50, 4, "300", clTeeColor
        .AddXY 2.5, 80, "120", clTeeColor
        .AddXY 120, 5, "600", clTeeColor
        .AddXY 10, 2, "333", clTeeColor
        .AddXY 200, 8, "456", clTeeColor
    End With
    
    TChart1.Axis.Bottom.Labels.Style = talValue
    
    With TChart1.Tools
        .Add tcMarksTip
        With .Items(0).asMarksTip
            .MouseAction = mtmClick
            .Delay = 0
        End With
    End With
End Sub