Page 1 of 1

Setting individual pointers

Posted: Thu Nov 30, 2006 4:52 am
by 9241637
Is it possible to change the style of a pointer within a series based on a value? For example, can I change the pointer from a psCircle to a psDiagCross and then back as I evaluate data from a query and supply it to the chart? I would like to make a line chart that would have pointers with a value of less than 22 to be circles and those greater than 22 to be diagonal crosses.

I've tried an if statement, but I must have something wrong.

Thanks

Posted: Thu Nov 30, 2006 6:53 am
by Marjan
Hi.

You could use point series OnGetPointerStyle event to change individual point pointer style. Something like this:

Code: Select all

function TForm1.Series1GetPointerStyle(Sender: TChartSeries;
  ValueIndex: Integer): TSeriesPointerStyle;
begin
  if Sender.MandatoryValueList[ValueIndex]>22 then result := psDiagCross
  else result := psCircle;
end;