Page 1 of 1

Determine X and Y values from mutiple functions

Posted: Thu Aug 13, 2015 7:37 am
by 16475102
Good day,

I am at a point were I am stuck and a bit confused with getting the correct x and y values for a specific point on the chart for functions or chart.

In the following example I have a bar chart with a stockhastic and macd function, I am trying to display all the current values at once on a label on the form, but with no luck do I get the correct values at once.

I have included a screen shot with my idea I am trying to accomplish.
xandy.png
Sample screen shot
xandy.png (303.11 KiB) Viewed 14408 times
Thank you for the support.

Re: Determine X and Y values from mutiple functions

Posted: Thu Aug 13, 2015 8:40 am
by narcis
Hi Gucci,

Based on this similar example I sent you some days ago, which problems do you have with it? You can access all series in a chart by their index so all functions series are also accessible. Series in a chart range from TChart.Series[0] to TChart.Series[TChart.SeriesCount-1]. Having that in mind you can access to all series with base series type (TChartSeries), cast them to their specific series type if needed (e.g.: TLineSeries, TBarSeries, TCandleSeries, etc.) and access all their properties and values.

Re: Determine X and Y values from mutiple functions

Posted: Thu Aug 13, 2015 9:06 am
by 16475102
Good day Narcis,

Sorry maybe I am just miss understanding the concept about the values under the specific axis that is why I ask you this question to understand better how to identify each one and all their values. Sorry for wasting your time.

Re: Determine X and Y values from mutiple functions

Posted: Thu Aug 13, 2015 9:25 am
by narcis
Hi Gucci,

Basically, series and axes in TeeChart have methods to retrieve values from given screen coordinates and viceversa: CalcPosValue, CalcXPos, CalcXPosValue, CalcXSizeValue, etc. You need to use such methods to calculate the values you need, just as I did in my example.

I'm not sure about which are your specific questions. Please provide more detailed information or modify my example so that I can see your exact problems and be able to help you.

Re: Determine X and Y values from mutiple functions

Posted: Thu Aug 13, 2015 9:35 am
by 16475102
Hi Narcis,

I will have a look at my code and try and determine were the problem is.

Re: Determine X and Y values from mutiple functions

Posted: Thu Aug 13, 2015 7:15 pm
by 16475102
Hi,

I have created a sample application to try and explain what I am trying to accomplish. I am trying to display all the values of the functions and candlestick if I move my mouse over any area of the chart. At this stage the value only diplay if the mouse points to a specific function.

Re: Determine X and Y values from mutiple functions

Posted: Fri Aug 14, 2015 8:02 am
by narcis
Hi Gucci,

What you request is very similar to the interpolation example (All features\Welcome!\Chart Styles\Standard\Line (Strip)\Interpolating Line series) in the new features demo, available at TeeChart's program group, which I also implemented here. I also attach your project with the modifications applying the interpolating demo.