Getting YValues from a TColorGridSeries

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Elisabet
Newbie
Newbie
Posts: 22
Joined: Fri Nov 15, 2002 12:00 am
Location: Madrid

Getting YValues from a TColorGridSeries

Post by Elisabet » Thu Oct 27, 2005 8:14 am

for (x=0;x<1983;x=x+n)
{
for (z=0;z<987;z=z+m)
{
result=RoundTo(sin(x*Pi/180)*sin(z*Pi/180)+2,-3); //Rango de 1 a 3;
Series1->AddXYZ(x,result,z);
index=Series1->Clicked(x,z);
if (index!=-1 ) data= float(Series1->YValues->Value[index]);
data= Series1->GetXZValue(x,z);
}
}

Hello,

I’ve written this program to use the function GetXZValue to get the Y value of a TcolorGrid Serie. In this program, the index assigned is always –1 so I can’t get the correct value usuing Series1->YValues->Value[index]. And the other way was using GetXZValue but it always gives a data equal to zero. So… how could I use afterwards the values of Series1? Which function should I use?

Thank you in advance,

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

Post by Narcís » Thu Oct 27, 2005 9:58 am

Hi Elisabet,

Clicked method doesn't work for those series types. This is a known problem which is listed on our defect list to be fixed for future releases.

Considering the code you posted you could easily retrieve Y Values by using something like:

Code: Select all

  for (x=0;x<1983;x=x+n)
  {
    for (z=0;z<987;z=z+m)
    {
      result=RoundTo(sin(x*M_PI/180)*sin(z*M_PI/180)+2,-3); //Rango de 1 a 3;
      Series1->AddXYZ(x,result,z);
      data= Series1->YValues->Value[(Series1->Count())-1];
    }
  }
However, this is somewhat redundant as you already have that Y Value stored in result.

Depending on what you are trying to get you may be interested in having a look at this message where I posted an example on how you could get Y Values from some a clicked point or a drawn rectangle.
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

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

Post by Narcís » Fri Oct 28, 2005 10:26 am

Hi Elisabet,
Clicked method doesn't work for those series types. This is a known problem which is listed on our defect list to be fixed for future releases.
Sorry Elisabet, but I've found Clicked already works fine with latest TeeChart release which is v7.05. However, it has to be used with horizontal and vertical screen pixel coordinates.
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