Page 1 of 1

Get ValueIndex

Posted: Mon Oct 13, 2008 10:04 am
by 15049298
Is there any way to get the ValueIndex of a Ganttchart when the OnMarkTipToolGetText Event is fired up?

Thanks
JD

Posted: Mon Oct 13, 2008 12:13 pm
by narcis
Hi JD,

I'm afraid this is not possible unless the original text contains it and you can parse the text to obtain the index. You could also search through series labels for the index which contains the text being processed, for example:

Code: Select all

Private Sub TChart1_OnMarkTipToolGetText(ByVal Tool As Long, Text As String)
    For i = 0 To TChart1.Series(0).Count - 1
        If Text = TChart1.Series(0).PointLabel(i) Then
            ValueIndex = i
        End If
    Next
End Sub

Posted: Mon Oct 13, 2008 12:26 pm
by 15049298
The problem is that the text is not unique. Thx for your reply. Can you maybe put it on the wishlist?

Posted: Mon Oct 13, 2008 12:52 pm
by narcis
Hi JD,

Sure, just added it to be considered for inclusion in next releases.