move tool available outside of TeeCommander1
move tool available outside of TeeCommander1
Hi:
I'm successfully using the rotate and magnifying tools. Now I want to a "move" tool, similar to what the TeeCommander does, but don't want to use the commander per se.
Can I use this tool outside of the commander? Or is this function only available in the commander?
Thanks,
Matt
I'm successfully using the rotate and magnifying tools. Now I want to a "move" tool, similar to what the TeeCommander does, but don't want to use the commander per se.
Can I use this tool outside of the commander? Or is this function only available in the commander?
Thanks,
Matt
Hi Matt,
I'm afraid there's no tool to move the chart. Otherwise, you always can emulate this TeeCommander function by doing something similar than following:
I'm afraid there's no tool to move the chart. Otherwise, you always can emulate this TeeCommander function by doing something similar than following:
Code: Select all
Dim MoveChart As Boolean
Dim StartX, StartY As Double
Private Sub Form_Load()
TChart1.AddSeries scPoint
TChart1.Series(0).FillSampleValues 25
MoveChart = False
TChart1.Zoom.Enable = 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)
If Button = mbLeft Then
StartX = X
StartY = Y
MoveChart = True
End If
End Sub
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If MoveChart = True Then
With TChart1
.Aspect.HorizOffset = X - StartX
.Aspect.VertOffset = Y - StartY
End With
End If
End Sub
Private Sub TChart1_OnMouseUp(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If Button = mbLeft Then
With TChart1
.Aspect.HorizOffset = X - StartX
.Aspect.VertOffset = Y - StartY
End With
MoveChart = False
End If
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi Matt,
Here you have an example of how you could achieve similar results as teecommander, using simple buttons:
Here you have an example of how you could achieve similar results as teecommander, using simple buttons:
Code: Select all
Dim RotateChart, MoveChart, ZoomChart, DChart, Go As Boolean
Dim StartX, StartY As Double
Dim StartZoom As Integer
Private Sub Rotate_Click()
RotateChart = True
MoveChart = False
ZoomChart = False
DChart = False
End Sub
Private Sub Reset_Click()
With TChart1
.Aspect.Orthogonal = True
.Aspect.HorizOffset = 0
.Aspect.VertOffset = 0
.Aspect.Zoom = 100
.Aspect.Chart3DPercent = 15
End With
MoveChart = False
RotateChart = False
ZoomChart = False
DChart = False
Go = False
End Sub
Private Sub Move_Click()
MoveChart = True
RotateChart = False
ZoomChart = False
DChart = False
End Sub
Private Sub Zoom_Click()
ZoomChart = True
MoveChart = False
Rotate = False
DChart = False
End Sub
Private Sub ThreeDPercent_Click()
DChart = True
ZoomChart = False
MoveChart = False
Rotate = False
End Sub
Private Sub Editor_Click()
TChart1.ShowEditor
End Sub
Private Sub Form_Load()
With TChart1
.AddSeries scLine
.Series(0).FillSampleValues 20
.Zoom.Enable = False
.Scroll.Enable = pmNone
End With
End Sub
Private Sub TChart1_OnMouseDown(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If RotateChart = True Then
Go = True
StartX = X
StartY = Y
End If
If MoveChart = True Then
Go = True
StartX = X
StartY = Y
End If
If ZoomChart = True Then
Go = True
StartZoom = TChart1.Aspect.Zoom
StartY = Y
End If
If DChart = True Then
Go = True
StartX = X
StartY = Y
End If
End Sub
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If RotateChart = True And Go = True Then
With TChart1
.Aspect.Orthogonal = False
.Aspect.Elevation = X - StartX
.Aspect.Rotation = Y - StartY
End With
End If
If MoveChart = True And Go = True Then
With TChart1
.Aspect.HorizOffset = X - StartX
.Aspect.VertOffset = Y - StartY
End With
End If
If ZoomChart = True And Go = True Then
With TChart1
.Aspect.Zoom = StartZoom + StartY - Y
End With
End If
If DChart = True And Go = True Then
With TChart1
If (X - StartX) < 101 And (X - StartX) > 0 Then
.Aspect.Chart3DPercent = X - StartX
Else
If (X - StartX) > 101 Then
.Aspect.Chart3DPercent = 100
Else
.Aspect.Chart3DPercent = 1
End If
End If
End With
End If
End Sub
Private Sub TChart1_OnMouseUp(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If RotateChart = True Then
With TChart1
.Aspect.Orthogonal = False
.Aspect.Elevation = X - StartX
.Aspect.Rotation = Y - StartY
End With
Go = False
End If
If MoveChart = True Then
With TChart1
.Aspect.HorizOffset = X - StartX
.Aspect.VertOffset = Y - StartY
End With
Go = False
End If
If ZoomChart = True Then
With TChart1
.Aspect.Zoom = StartZoom + StartY - Y
End With
Go = False
End If
If DChart = True Then
With TChart1
If (X - StartX) < 101 And (X - StartX) > 0 Then
.Aspect.Chart3DPercent = X - StartX
Else
If (X - StartX) > 101 Then
.Aspect.Chart3DPercent = 100
Else
.Aspect.Chart3DPercent = 1
End If
End If
End With
Go = False
End If
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi:
This code is working fairly nicely (with a few minor mods). Thanks again.
I need to turn off the default left-click mouse behavior that drags and grid around independently of the plotting data, since in some cases, it interferes with the functions in the code you provided. How is that done?
Thanks,
Matt
This code is working fairly nicely (with a few minor mods). Thanks again.
I need to turn off the default left-click mouse behavior that drags and grid around independently of the plotting data, since in some cases, it interferes with the functions in the code you provided. How is that done?
Thanks,
Matt
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Matt,
Sorry for the confusion. In that case you can try using this:
Sorry for the confusion. In that case you can try using this:
Code: Select all
TChart1.Zoom.Enable = False
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |