Page 1 of 1

Pointer.Transparency behaviour

Posted: Tue Jun 09, 2009 4:25 pm
by 9640703
Hi, team. I'm using version 2.0 of Teechart library.

I would like to write code like this

Code: Select all

 private void Test()
{
  Points points = new Points();
  ...
  points.GetPointerStyle += SomeMethod;
}

 private void SomeMethod(CustomPoint series, CustomPoint.GetPointerStyleEventArgs e)
{
   if (someCondition)
  {
    series.Pointer.Transparency = 100; 
  }
  else
  {
    series.Pointer.Transparency = 0;
  }
}
Suddenly it works only for every point except the first one. Could you help me to undertand the problem here or provide the workaround for this issue if possible?

Posted: Wed Jun 10, 2009 10:11 am
by 10050769
Hello gs,


In version 2 if you want change some propierty color pointer, you needs event, but the first value of series you can change before event for example:

Code: Select all

 private void Test()
{
  Points points = new Points();
  ...
   points.Pointer.Transparency = 100;
  points.GetPointerStyle += SomeMethod;
} 

 private void SomeMethod(CustomPoint series, CustomPoint.GetPointerStyleEventArgs e)
{
   if (someCondition)
  {
    series.Pointer.Transparency = 100;
  }
  else
  {
    series.Pointer.Transparency = 0;
  }
} 
I hope that will helps.

Thanks,

Posted: Wed Jun 10, 2009 11:04 am
by 9640703
Thanks, but I don't know state of the data which is associated with point and at the moment of line creation so I can't decide what to prefer here. Any other suggestions?

Posted: Wed Jun 10, 2009 11:13 am
by narcis
Hi gs,

You should apply that condition to the first series point after adding the value to the series and before the GetPointerStyle event is fired. In v2 that event was not designed for changing pointer's color. This feature was added in v3.

Posted: Wed Jun 10, 2009 2:03 pm
by 9640703
Thank you, works fine now.