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...
Setting individual points in TPointSeries to different color
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:
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;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com