Hi Steema,
I want to move a colorline to middle of graph after zooming.
Currently,I use event OnMouseDown to get previous bottom XValue, and OnMouseUp to get current bottom XValue.
After zooming, i move colorline by setting colorline.value = (PreviousX+CurrentX)/2
But it was not good . Sometimes, the colorline is not at center of graph, sometime it was disappeared of graph.
Please give us your advice in this case. How to do this in better way?
I use TeeChart ActiveX 7J.
Thanks and best regards.
Move ColorLine to middle of graph after zooming
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Haianh,
You can do something like this:
You can do something like this:
Code: Select all
Private Sub Form_Load()
TChart1.AddSeries scPoint
TChart1.Series(0).FillSampleValues 10
TChart1.Tools.Add tcColorLine
TChart1.Tools.Items(0).asColorLine.Axis = TChart1.Axis.Left
End Sub
Private Sub TChart1_OnZoom()
With TChart1.Axis.Left
TChart1.Tools.Items(0).asColorLine.Value = .Minimum + (.Maximum - .Minimum) / 2
End With
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Haianh,
You're very welcome. I'm glad to hear that helped.
You're very welcome. I'm glad to hear that helped.
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 |