Page 1 of 1

Memory Consuming TSeriesMarks

Posted: Mon Jul 12, 2004 10:20 am
by 9336923
Hello,

Imagine this situation: there are cca 1000000 values given and you have to add marks for few points(cca 5-10%).
The only possibility i know about is to set for each point
Series.Marks.visible:=true(or false).

and then,
TSeriesMarks.Visible:=true;

This takes a lot of memory and computing time.

Does anyone know about better solution(for example drawing only
marks i want to make visible)?

Posted: Mon Jul 12, 2004 10:32 am
by Marjan
Hi.

You could use series Marks.DrawEvery to reduce the number of marks displayed. Example:

Code: Select all

Series1.Marks.DrawEvery := 15;
Alternatively, if you want to display only specific series marks, you can also use series OnGetMarkText event. Example:

Code: Select all

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
  ValueIndex: Integer; var MarkText: String);
begin
  // display only 46th and 113rd point mark
  if (ValueIndex <> 45) or (ValueIndex <> 112) then MarkText := '';
end;

Posted: Mon Jul 12, 2004 11:47 am
by 9336923
Thankx Marjan,

Series1GetMarkText works :) .