Selecting multiple points

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Lizabeth
Newbie
Newbie
Posts: 24
Joined: Thu Nov 13, 2003 5:00 am
Location: Sweden

Selecting multiple points

Post by Lizabeth » Mon Jun 28, 2004 1:00 pm

Hello!

I want to let the user be able to press the right mouse button, drag the mouse and then finally release the mouse button in a chart, to "select" an area within that chart. (Similar to how you select an area when you zoom, only that you use the left mouse button then.)

When the user releases the right mouse button I want to determine what points in the series lies within the "selected" area. Is this possible?

Best regards
Elisabeth

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

Post by Pep » Tue Jun 29, 2004 8:13 am

Hi Elisabeth,
When the user releases the right mouse button I want to determine what points in the series lies within the "selected" area. Is this possible?
Yes, this can be done using the OnMouseDown and OnMouseUp events to determine the mouse position , i.e. :

Code: Select all

    Private Sub TChart1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TChart1.MouseDown
        ValX = e.X
    End Sub

    Private Sub TChart1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TChart1.MouseUp
        ValX2 = e.X
        Label1.Text = "from point : " + TChart1.Series(0).XScreenToValue(ValX).ToString + " to point : " + TChart1.Series(0).XScreenToValue(ValX2).ToString
    End Sub

Post Reply