Memory Consuming TSeriesMarks

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Kamil
Newbie
Newbie
Posts: 7
Joined: Tue Mar 30, 2004 5:00 am
Location: Bratislava

Memory Consuming TSeriesMarks

Post by Kamil » Mon Jul 12, 2004 10:20 am

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)?

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

Post by Marjan » Mon Jul 12, 2004 10:32 am

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;
Marjan Slatinek,
http://www.steema.com

Kamil
Newbie
Newbie
Posts: 7
Joined: Tue Mar 30, 2004 5:00 am
Location: Bratislava

Post by Kamil » Mon Jul 12, 2004 11:47 am

Thankx Marjan,

Series1GetMarkText works :) .

Post Reply