Teechart fastline tooltips?

TeeChart for ActiveX, COM and ASP
Post Reply
tsoffers
Newbie
Newbie
Posts: 5
Joined: Thu Jan 12, 2006 12:00 am
Location: Oevel, Belgium
Contact:

Teechart fastline tooltips?

Post by tsoffers » Thu Jun 05, 2008 10:21 am

Hi,

I'm wondering whether it's possible to add some sort of tooltip to each series' fastline in a teechart (version 7 ActiveX). We display up to 30 lines in one chart, which sometimes makes it a bit blurry to read line names and values. Therefore it would be easy to have each line's name and value displayed at the point where the mouse cursor hovers over it.
Is this included in TeeChart Pro v7? If so, how do I program it?

Thanks a lot in advance.
Tom.

ps. I'm pretty much of a programming newbie... :oops:

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jun 05, 2008 11:01 am

Hi tsoffers,

Yes, there's MarksTips tool for that. You can use the tool for displaying the hints and associated events to customize the text on them.

You'll find MarkTips tool examples at All Features\Welcome!\Tools\Marks Tip in the features demo. You may also be interested in having a look at Tutorial 19 - The TeeChart Tool Collection. Tutorials and demo are available at TeeChart's program group.

An example of what you request would be something like this:

Code: Select all

Dim SeriesIndex As Integer

Private Sub Form_Load()
    For i = 0 To 4
        TChart1.AddSeries scLine
        TChart1.Series(i).FillSampleValues 10
    Next
    
    SeriesIndex = -1
    
    TChart1.Tools.Add tcMarksTip
End Sub

Private Sub TChart1_OnMarkTipToolGetText(ByVal Tool As Long, Text As String)
    If SeriesIndex <> -1 Then
        Text = TChart1.Series(SeriesIndex).Name & ": " & Text
    End If
End Sub

Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
    For i = 0 To TChart1.SeriesCount - 1
        If TChart1.Series(i).Clicked(X, Y) <> -1 Then
            SeriesIndex = i
        End If
    Next
End Sub
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

tsoffers
Newbie
Newbie
Posts: 5
Joined: Thu Jan 12, 2006 12:00 am
Location: Oevel, Belgium
Contact:

Post by tsoffers » Fri Jun 06, 2008 12:00 pm

Thanks a lot, and it seems to work too. The only thing that I can't get to happen, is this:

I'd like it to show the series' name as well. The value that's displayed is okay, but it always adds the name of the first series, and not the one the cursor hovers over.

Code: Select all

Private Sub TChart1_OnMarkTipToolGetText(ByVal Tool As Long, Text As String)
    If SeriesIndex <> -1 Then
        Text = TChart1.Series(SeriesIndex).Name & ": " & Text
    End If
End Sub
So it's always the TChart1.Series(SeriesIndex).name of the first series that is filled in, and when I put a stop, the 'SeriesIndex' variable returns an 'Empty' value.
How can I get the SeriesIndex filled in with the series index of the series the cursor is hovering over?

Thanks again!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jun 06, 2008 1:14 pm

Hi tsoffers,

It works fine for me here using exactly the same code as I posted in my previous reply and using TeeChart Pro v8.0.0.3 ActiveX. Are you using the very same code? Which TeeChart version are you using?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

tsoffers
Newbie
Newbie
Posts: 5
Joined: Thu Jan 12, 2006 12:00 am
Location: Oevel, Belgium
Contact:

Post by tsoffers » Mon Jun 09, 2008 8:08 am

OK, I got it to work now. I forgot to declare the SeriesIndex variable.

Thanks!

Post Reply