Hi,
After I draw a curve,is there any way or function that I can get knee points of the curve?
Thanks,
Robinson
how to get knee points?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: how to get knee points?
Hi Robinson,
There's no way to do this automatically. However, you can easily do that comparing series points like this:
There's no way to do this automatically. However, you can easily do that comparing series points like this:
Code: Select all
Private Sub Form_Load()
TChart1.Aspect.View3D = False
TChart1.AddSeries scLine
TChart1.Series(0).FillSampleValues 100
TChart1.AddSeries scPoint
Dim Ascending As Boolean
For i = 2 To TChart1.Series(0).Count
Ascending = False
If TChart1.Series(0).YValues.Value(i - 2) < TChart1.Series(0).YValues.Value(i - 1) Then
Ascending = True
End If
If Ascending And (TChart1.Series(0).YValues.Value(i - 1) > TChart1.Series(0).YValues.Value(i)) Then
TChart1.Series(1).AddXY TChart1.Series(0).XValues.Value(i - 1), TChart1.Series(0).YValues.Value(i - 1), "", clTeeColor
End If
If Not Ascending And (TChart1.Series(0).YValues.Value(i - 1) < TChart1.Series(0).YValues.Value(i)) Then
TChart1.Series(1).AddXY TChart1.Series(0).XValues.Value(i - 1), TChart1.Series(0).YValues.Value(i - 1), "", clTeeColor
End If
Next i
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 |
Re: how to get knee points?
Hi,Narcís Calvet
THank you,you code gave me a way to solve it.
Cheers,
Robinson,
THank you,you code gave me a way to solve it.
Cheers,
Robinson,