Hi all,
I would like to obtain Y value using a X date-time value.
Does exist in TeeChart API a method to do this?
Best regards,
Alex
Get Y value using X date-time value
Re: Get Y value using X date-time value
After some tests I think TeeChart API performs an interpolation using pixels values and axis values, and that return value is not related to the data series.
Obtain the index related to a given data serie is something easy to achieve using a binary search over data stored in the serie and is quick also(underlinear). So I have done this in my code.
Anyway, if exists a quicker way to do this with the API (using other precalculated data or whatever) it would be great.
Best regards,
Alex
Obtain the index related to a given data serie is something easy to achieve using a binary search over data stored in the serie and is quick also(underlinear). So I have done this in my code.
Anyway, if exists a quicker way to do this with the API (using other precalculated data or whatever) it would be great.
Best regards,
Alex
Re: Get Y value using X date-time value
Hi Alex,
I'm afraid the only way to ensure you get the correct YValue from a given XValue is, as you've found, looking for it manually. Note that there can be several points with the same XValue but different YValue; or there can also be no points in a given XValue.
Of course, depending on the particularities of your values, the search can be optimized, but this example could help you to do what you want.
I'm afraid the only way to ensure you get the correct YValue from a given XValue is, as you've found, looking for it manually. Note that there can be several points with the same XValue but different YValue; or there can also be no points in a given XValue.
Of course, depending on the particularities of your values, the search can be optimized, but this example could help you to do what you want.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |