Can you change individual series Pointer.Style values

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
CAC
Newbie
Newbie
Posts: 44
Joined: Tue Jun 20, 2006 12:00 am
Location: Plain City, Ohio
Contact:

Can you change individual series Pointer.Style values

Post by CAC » Fri Apr 20, 2007 1:47 am

In my line series chart, I want to be able to change individual pointer styles along a line. I am charting analytical results and I want to be able to let my users know when a value is an actual result, and when the value represents a detection limit.

For instance the value 100 would have a psCircle and the value 5 would get a psStar. I can check each record as it is read to see if it was detected or not, so that part is easy.

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 Apr 20, 2007 1:10 pm

Hi CAC,

Yes, you can do that using OnGetPointerStyle event. Here you'll find an example of this event's usage.
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

CAC
Newbie
Newbie
Posts: 44
Joined: Tue Jun 20, 2006 12:00 am
Location: Plain City, Ohio
Contact:

Post by CAC » Sat Apr 28, 2007 10:08 pm

I have reviewed and implemented the code you suggested, but when I try it, the Chart always changes the pointer style for the entire series, not individual points. :?

Yeray
Site Admin
Site Admin
Posts: 9533
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Mon Apr 30, 2007 8:57 am

Hi CAC,

So you should do something like this:

Code: Select all

if (Series1.YValue[ValueIndex] = 100) then
    result := psCircle //for value 100 will be psCircle
  else if (Series1.YValue[ValueIndex] = 5) then
    result := psStar  //for value 5 will be psStar
    else
      result := psRectangle; //default will be psRectangle
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

CAC
Newbie
Newbie
Posts: 44
Joined: Tue Jun 20, 2006 12:00 am
Location: Plain City, Ohio
Contact:

Post by CAC » Fri May 04, 2007 10:09 pm

I think part of my problem is my lack of understanding of [ValueIndex]. My point style is determined by a string value that is not part of the XY data set. The Detected column is evaluated as the program steps through a ClientData set.

For instance:

X Values.....Y Values......Detected......Point Style
1/1/2000.......100.............Yes.............psCircle
2/1/2000..........5..............No..............psStar
3/1/2000.........25.............Yes.............psCircle

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Sun May 06, 2007 7:35 am

Hi, CAC.

ValueIndex = point index in series point ValueList array. In your case I assume the number of points is equal to number of points in ClinetDataSet. In this case ValueIndex would be equal to record position in ClientDataSet. If this is not true you can still create an array of bookmarks and "link" point index (ValueIndex) to record bookmark. I think there is an example of this available in TC demo. But as I said, in your case I think this is not necessary i.e. a simple ValueIndex=record position mapping would do the trick. What you have to do is in OnGetPointerStyle event read point ValueIndex, locate it's match in ClientDataSet, read matched "Displayed" column value and base OnGetPointerStyle result on it's value.
An alternative and much simpler solution would be to store "Displayed" column values in series XLabels array (simply connect column to series labels source property) and then use the same event with ValueIndex and XLabels[ValueIndex] to set pointer style. In case you'll have problems implementing this, drop me an email at "marjan at steema dot com" and I'll prepare a sample application for you.
Marjan Slatinek,
http://www.steema.com

Post Reply