Drag on Horizontal Axis !

TeeChart for ActiveX, COM and ASP
Post Reply
Petar
Newbie
Newbie
Posts: 40
Joined: Tue Oct 06, 2009 12:00 am

Drag on Horizontal Axis !

Post by Petar » Tue Nov 02, 2010 11:28 am

Hi,

I wonder if you knew the event that captures the drag on the horizontal axis ?

Best Regards.

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

Re: Drag on Horizontal Axis !

Post by Narcís » Tue Nov 02, 2010 12:23 pm

Hi User1,

You can do something like this:

Code: Select all

Option Explicit

Dim BottomAxisSelected As Boolean

Private Sub Form_Load()
    TChart1.AddSeries scBar
    TChart1.Series(0).FillSampleValues 10
    BottomAxisSelected = False
End Sub

Private Sub TChart1_OnMouseDown(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
    BottomAxisSelected = TChart1.Axis.Bottom.Clicked(X, Y)
End Sub

Private Sub TChart1_OnScroll()
    If BottomAxisSelected Then
        TChart1.Header.Text(0) = "Bottom axis scrolled!!"
    Else
        TChart1.Header.Text(0) = ""
    End If
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

Petar
Newbie
Newbie
Posts: 40
Joined: Tue Oct 06, 2009 12:00 am

Re: Drag on Horizontal Axis !

Post by Petar » Tue Nov 02, 2010 1:15 pm

Thanks, i did something like this :

Private Sub AxTChart_OnMouseUp(ByVal sender As Object, ByVal e As AxTeeChart.ITChartEvents_OnMouseUpEvent) Handles AxTChart.OnMouseUp

MouseUpX = e.x
MouseUpY = e.y

If AxTChart.Axis.Bottom.Clicked(MouseDownX, MouseDownY) Then AxTChart_OnZoom(Nothing, Nothing)

End Sub

Post Reply