TIsoSurfaceSeries and XZ plot

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
toxi
Newbie
Newbie
Posts: 4
Joined: Mon Jun 15, 2009 12:00 am

TIsoSurfaceSeries and XZ plot

Post by toxi » Thu Feb 17, 2011 6:33 pm

Hi!
I am trying to draw an array of values with the TIsoSurfaceSeries, and I want to display my data in XZ-plane. The problem is that when I set View3D:=false, TeeChart is using XY-plane to display the data. How can I set up 2D views of TIsoSurfaceSeries' objects (TeeChartPro 8.05)?

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

Re: TIsoSurfaceSeries and XZ plot

Post by Yeray » Fri Feb 18, 2011 12:04 pm

Hi toxi,

Have you tried using a ColorGrid instead of a Surface in 2D or viewed from the top?

Suface Series viewed from the top:

Code: Select all

uses TeeSurfa;

procedure TForm1.FormCreate(Sender: TObject);
var x, z: integer;
begin
  Chart1.Chart3DPercent:=100;
  Chart1.Aspect.Orthogonal:=false;
  Chart1.Aspect.Zoom:=70;
  Chart1.Aspect.Rotation:=0;
  Chart1.Aspect.Elevation:=270;
  Chart1.Legend.Visible:=false;

  with Chart1.AddSeries(TSurfaceSeries) as TSurfaceSeries do
  begin
    for x:=0 to 9 do
      for z:=0 to 9 do
        AddXYZ(x, random*10, z);
  end;
end;
ColorGrid Series:

Code: Select all

uses TeeSurfa;

procedure TForm1.FormCreate(Sender: TObject);
var x, z: integer;
begin
  Chart1.View3D:=false;
  Chart1.Legend.Visible:=false;

  with Chart1.AddSeries(TColorGridSeries) as TColorGridSeries do
  begin
    for x:=0 to 9 do
      for z:=0 to 9 do
        AddXYZ(x, random*10, z);
  end;
end;
If that's not what you are trying to do, please try to arrange a simple example project we can run as-is to reproduce the problem here.
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

toxi
Newbie
Newbie
Posts: 4
Joined: Mon Jun 15, 2009 12:00 am

Re: TIsoSurfaceSeries and XZ plot

Post by toxi » Fri Feb 18, 2011 9:02 pm

Hi Yeray,

Thanks! Your answer was helpful. But I have some problems.

1) There is no filled area on the Fig.1. Values Y=YValues.MaxValue (13e-4) are located under no filled area.
2) When I zoom, surface is out of axis (fig. 2).
Fig .1
Image
Fig. 2
Image

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

Re: TIsoSurfaceSeries and XZ plot

Post by Yeray » Tue Feb 22, 2011 1:55 pm

Hi toxi,
toxi wrote:1) There is no filled area on the Fig.1. Values Y=YValues.MaxValue (13e-4) are located under no filled area.
Could you please try to arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
toxi wrote:2) When I zoom, surface is out of axis (fig. 2).
You could try doing something similar to the demo at "All features\Welcome !\Axes\Opaque zones" in the feature demo program included in the installation.
If you still have problems with it, don't hesitate to let us know.
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

toxi
Newbie
Newbie
Posts: 4
Joined: Mon Jun 15, 2009 12:00 am

Re: TIsoSurfaceSeries and XZ plot

Post by toxi » Wed Feb 23, 2011 12:40 am

Hi Yeray

I uploaded TestIsoSurf.zip. Project compiled with Delphi 6 and TeeChartPro v.8.07.
There are problems in this project:
1) The array of values from Data.xml (program load it when started) is painted not correctly in the TeeChart. But a ChartEditor.Data's table shows perfectly this data when button "3D" is not down. If the ChartEditor.Data's button "3D" is down, table shows the array of data also not correctly. Source_Field.xml contains the field of data, which I am trying to draw using TeeChart
2) There is no filled area with a values=YValues.MaxValue
3) The problem with zoom is disappear in TeeChart 8.07 (Early I used 8.05) , about which I wrote in the previous post. But zoomed area is shifted relatively the left-top point of zoom's rectangle in this version.
I'm sorry, my English is bad.

Please help!

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

Re: TIsoSurfaceSeries and XZ plot

Post by Yeray » Fri Feb 25, 2011 12:01 pm

Hi toxi,

We think this could be probably better to be drawn with a Contour or a ColorGrid series. Here is how it looks changing the series to a Contour series:

Code: Select all

procedure TFIsoSurf.FormCreate(Sender: TObject);
var tmpSeries: TChartSeries;
begin
{  Chart1.Chart3DPercent:=100;
  Chart1.Aspect.Orthogonal:=false;
  Chart1.Aspect.Zoom:=70;
  Chart1.Aspect.Rotation:=0;
  Chart1.Aspect.Elevation:=270;
  Chart1.Aspect.Perspective:=0;
}
  Chart1.View3D:=False;

  Chart1.Legend.Visible:=true;
  XMLSource.FileName:=ExtractFileDir(paramstr(0))+'\Data.xml';
  XMLSource.Load;
  TIsoSurfaceSeries(Chart1.Series[0]).PaletteSteps:=4;
  TIsoSurfaceSeries(Chart1.Series[0]).ValueFormat:='00e-0';
  tmpSeries:=Chart1[0];
  ChangeSeriesType(tmpSeries, TContourSeries);
end;
Contour.jpg
Contour.jpg (122.49 KiB) Viewed 5594 times
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

toxi
Newbie
Newbie
Posts: 4
Joined: Mon Jun 15, 2009 12:00 am

Re: TIsoSurfaceSeries and XZ plot

Post by toxi » Sun Feb 27, 2011 7:42 pm

Hi Yeray,

There was a mistake on the screenshot from your previuos post: the central area of figure must not be grey colored. Maybe it is a bug with a Palette using. I found what the subfunction CalcFirstLevel of method TIsoSurfaceSeries.DrawCell(x, z: Integer) returns the wrong result - second level in palette. I changed the CalcFistLevel how it looks below. You can see the result on screenshot. It seems that the Controurseries and IsoSurfaceSeries fill correctly.

Code: Select all

  
TeeSufra.pas

procedure TIsoSurfaceSeries.DrawCell(x, z: Integer);
....
function CalcFirstLevel:Integer;
  var i: Array[0..3] of Integer;
      t: Integer;
      tmpM,
      tmpV : TChartValue;
  begin
    // Search first palette level
    i[0]:=ValueIndex0;
    i[1]:=ValueIndex1;
    i[2]:=ValueIndex2;
    i[3]:=ValueIndex3;

    tmpMin:=i[0];
    tmpV:=v[tmpMin];
    tmpM:=tmpV;
    tmpMax:=tmpMin;

    for t:=1 to 3 do
    begin
      if v[i[t]]<tmpV then
      begin
        tmpV:=v[i[t]];
        tmpMin:=i[t];
      end
      else
      if v[i[t]]>tmpM then
      begin
        tmpM:=v[i[t]];
        tmpMax:=i[t];
      end;
    end;

    result:=-1;

    for t:=0 to PaletteLength-1 do
    With Palette[t] do
//if UpToValue>tmpV then 
// fix
    if UpToValue>=tmpV then
//
    begin
      result:=t;
      break;
    end;
  end;
Filled ContourSeries
Image

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

Re: TIsoSurfaceSeries and XZ plot

Post by Yeray » Mon Feb 28, 2011 2:48 pm

Hi toxi,

I've added your suggestion to the wish list to be studied for future releases (TV52015423).
Anyways, I'm glad to see you've found a way to draw it as you want.
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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: TIsoSurfaceSeries and XZ plot

Post by Narcís » Fri Mar 25, 2011 11:05 am

Hi toxi,

Thanks for your feedback. Just wanted to let you know that I have included your enhancement suggestion for next TeeChart VCL release.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply