Hi,
How can I get yval from another series xval? For example, if I have two series,
Series1->AddXY(0, 0);
Series1->AddXY(.25, 1);
With what function return a yval I want to get from Series1's yvals in the range 0 to .25 for Series2 or if I want to get a yvalue from Series1 at x = 0.20, what can I do?
Thanks
John
Get Yval from Xval
-
- 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 |
Hi Narcís,
Thanks for a quick response. The example in the link seems too slow for me to search for a point from a series. Let say for each quarter of second(250 msecs) I have to show:
Series 1 has two points:
x1 = 0.0 y1= 0.0
x2 = 0.25 y2= 3.456
Series2 has 6000 points:
x2 = 0.0 y2 = y1(at x2) + a random number
...
x2 = 0.25 y2 = y1(at x2) + a random number
Does tchart has something like float y1 = Series1->GetY(x2) so I don't need to go through a loop to find out the value of index first.
Thanks
John
Thanks for a quick response. The example in the link seems too slow for me to search for a point from a series. Let say for each quarter of second(250 msecs) I have to show:
Series 1 has two points:
x1 = 0.0 y1= 0.0
x2 = 0.25 y2= 3.456
Series2 has 6000 points:
x2 = 0.0 y2 = y1(at x2) + a random number
...
x2 = 0.25 y2 = y1(at x2) + a random number
Does tchart has something like float y1 = Series1->GetY(x2) so I don't need to go through a loop to find out the value of index first.
Thanks
John
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi John,
Ok, in that case you can try doing something like this:
Hope this helps!
Ok, in that case you can try doing something like this:
Code: Select all
index:=Series1.XValues.Locate(x2);
y1:=Series1.YValue[index];
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 John,
In that case the only solution I can think of is the interpolating example I pointed you.
In that case the only solution I can think of is the interpolating example I pointed you.
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 John,
This example basically consists on interpolating series's y values from cursor's XValue. For this interpolation, the series's points before and after the cursor's position are used.
We don't have a C++ example of this at the moment. Are you having any specific problem porting the code?
This example basically consists on interpolating series's y values from cursor's XValue. For this interpolation, the series's points before and after the cursor's position are used.
We don't have a C++ example of this at the moment. Are you having any specific problem porting the code?
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 |