Determine X and Y values from mutiple functions

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Gucci
Newbie
Newbie
Posts: 22
Joined: Mon Jul 27, 2015 12:00 am

Determine X and Y values from mutiple functions

Post by Gucci » Thu Aug 13, 2015 7:37 am

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 14120 times
Thank you for the support.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Determine X and Y values from mutiple functions

Post by Narcís » Thu Aug 13, 2015 8:40 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Gucci
Newbie
Newbie
Posts: 22
Joined: Mon Jul 27, 2015 12:00 am

Re: Determine X and Y values from mutiple functions

Post by Gucci » Thu Aug 13, 2015 9:06 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Determine X and Y values from mutiple functions

Post by Narcís » Thu Aug 13, 2015 9:25 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Gucci
Newbie
Newbie
Posts: 22
Joined: Mon Jul 27, 2015 12:00 am

Re: Determine X and Y values from mutiple functions

Post by Gucci » Thu Aug 13, 2015 9:35 am

Hi Narcis,

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

Gucci
Newbie
Newbie
Posts: 22
Joined: Mon Jul 27, 2015 12:00 am

Re: Determine X and Y values from mutiple functions

Post by Gucci » Thu Aug 13, 2015 7:15 pm

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.
Attachments
sample.zip
Sample application
(11.93 KiB) Downloaded 808 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Determine X and Y values from mutiple functions

Post by Narcís » Fri Aug 14, 2015 8:02 am

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.
Attachments
sample.zip
(7.68 KiB) Downloaded 779 times
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply