Page 1 of 1

Drag on Horizontal Axis !

Posted: Tue Nov 02, 2010 11:28 am
by 15054354
Hi,

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

Best Regards.

Re: Drag on Horizontal Axis !

Posted: Tue Nov 02, 2010 12:23 pm
by narcis
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

Re: Drag on Horizontal Axis !

Posted: Tue Nov 02, 2010 1:15 pm
by 15054354
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