Tcontourseries

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
jpm
Newbie
Newbie
Posts: 8
Joined: Tue Oct 06, 2015 12:00 am

Tcontourseries

Post by jpm » Thu Nov 05, 2015 7:43 am

Is it possible to extract le numerical values of a contourseries for each of the selected levels?

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Tcontourseries

Post by Yeray » Mon Nov 16, 2015 9:20 am

Hello,

Excuse us for the delayed reply here.
Is this what you are trying to do?

Code: Select all

var i: Integer;
begin
  Chart1.Draw;

  for i:=0 to Series1.Levels.Count-1 do
    Memo1.Lines.Add(FormatFloat('#'+FormatSettings.ThousandSeparator+'##0'
      +FormatSettings.DecimalSeparator+'###', Series1.Levels[i].UpToValue));
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

jpm
Newbie
Newbie
Posts: 8
Joined: Tue Oct 06, 2015 12:00 am

Re: Tcontourseries

Post by jpm » Tue Dec 01, 2015 8:20 pm

map.png
map.png (180.27 KiB) Viewed 53870 times
What I would like to retrive are to points for each of the above colored lines at the different selected levels.
In the above example, I have lines at Level=59.919 . Level=57.437, ... some levels can be splitted in diffent level curve (here for example L=42.544 or 47.508 or...)
The goal is to save the equipotential/isothrm/equi-xxx positions for an external use.
best regards

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Tcontourseries

Post by Yeray » Wed Dec 02, 2015 12:06 pm

Hello,

I understand you are looking for the arrays of Points into the Segments into the Levels. Here you have a simple example printing all the X and Y values for each Points array in each Segment in each Level:

Code: Select all

var Series1: TContourSeries;

procedure TForm1.FormCreate(Sender: TObject);
var i, j, m: Integer;
    lvl: TContourLevel;
    seg: TLevelSegment;
begin
  Chart1.View3D:=false;
  Series1:=Chart1.AddSeries(TContourSeries) as TContourSeries;
  Series1.FillSampleValues();
  Series1.Marks.Visible:=true;

  Chart1.Draw;

  Memo1.ScrollBars:=ssVertical;
  Memo1.Lines.Clear;
  for i:=0 to Series1.Levels.Count-1 do
  begin
    lvl:=Series1.Levels.Items[i];
    Memo1.Lines.Add('Level: ' + IntToStr(i) + ', UpToValue: ' + FormatFloat('#,##0.###', lvl.UpToValue));

    for j:=0 to length(lvl.Segments)-1 do
    begin
      seg:=lvl.Segments[j];
      Memo1.Lines.Add('Segment: ' + IntToStr(j));

      for m:=0 to length(seg.Points)-1 do
      begin
        Memo1.Lines.Add('Point[' + IntToStr(m) + ']: (' + FormatFloat('#,##0.###', seg.Points[m].X) + ',' + FormatFloat('#,##0.###', seg.Points[m].Y) + ')');
      end;

      Memo1.Lines.Add('');
    end;

    Memo1.Lines.Add('');
  end;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

jpm
Newbie
Newbie
Posts: 8
Joined: Tue Oct 06, 2015 12:00 am

Re: Tcontourseries

Post by jpm » Tue Dec 08, 2015 1:40 pm

Tank you very much! It is exactelly le answer I was loocking for.

Post Reply