Page 1 of 1

Getting YValues from a TColorGridSeries

Posted: Thu Oct 27, 2005 8:14 am
by 8438229
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,

Posted: Thu Oct 27, 2005 9:58 am
by narcis
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.

Posted: Fri Oct 28, 2005 10:26 am
by narcis
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.