Page 1 of 1

Posted: Fri Apr 16, 2004 3:41 pm
by 5891318
maybe this will work...

ASeries := TPointSeries.Create;
ASeries.ParentChart := Chart1;
ASeries.FillSampleValues(10);

for i := 0 to ASeries.Count -1 do
begin
if ASeries.XValues < 5 then
ASeries.ValueColor := clGreen;

if ASeries.XValues > 5 then
ASeries.ValueColor := clWhite;
end;

etc...

Posted: Mon Apr 19, 2004 12:30 pm
by Marjan
Hi.

For some pointer styles TeeChart Pen color is not matched to current point color. A workaround is to manually "hard-code" Pen color right before the symbol is drawn. For this you can use series OnGetPointerStyle event. The following code works fine:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.FillSampleValues(3);
  Series1.ColorEachPoint := True;
end;

function TForm1.Series1GetPointerStyle(Sender: TChartSeries;
  ValueIndex: Integer): TSeriesPointerStyle;
begin
  Sender.ParentChart.Canvas.Pen.Color := Sender.ValueColor[ValueIndex];
  Result := psStar;
end;