Drawing a specific bandline on an IsoSurface plot

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Lampiao
Newbie
Newbie
Posts: 3
Joined: Wed Jul 18, 2012 12:00 am

Drawing a specific bandline on an IsoSurface plot

Post by Lampiao » Mon Jun 13, 2022 8:32 am

How to make an isosurface plot where all contour lines are disabled except one?

For example Series1.BandPen.Visible:=False for all levels except for the level Y=10

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

Re: Drawing a specific bandline on an IsoSurface plot

Post by Yeray » Thu Jun 16, 2022 9:38 am

Hello,

I'm afraid there's no property to do this.
However, you can do a trick. You can draw the series twice.
- First, draw the series without BandPen the first time, and prepare a special palette with a single Level .
- Secondly, draw the series without Brush and with a custom Palette which has a single Level with the desired UpToValue.

Ie:

Code: Select all

type TIsoSurfaceAccess=class(TIsoSurfaceSeries);

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.Legend.Hide;
  Chart1.Aspect.Orthogonal:=False;
  Chart1.Aspect.Zoom:=70;
  Chart1.Chart3DPercent:=100;


  with TIsoSurfaceSeries(Chart1.AddSeries(TIsoSurfaceSeries)) do
  begin
    FillSampleValues;
    BeforeDrawValues:=Series1BeforeDrawValues;
  end;
end;

procedure TForm1.Series1BeforeDrawValues(Sender: TObject);
var t: Integer;
begin
  with TIsoSurfaceAccess(Chart1[0]) do
  begin
    // Restore the series to draw the cells with the Brush but without the BandPen
    Brush.Style:=bsSolid;
    CreateDefaultPalette;
    BandPen.Visible:=False;
    DrawAllValues;

    // Prepare the series to draw the BandPen with the modified palette, without the Brush
    BandPen.Visible:=True;
    Brush.Style:=bsClear;
    CreateDefaultPalette(1);
    Palette[0].UpToValue:=0.2;
  end;
end;
Project1_2022-06-16_11-33-34.png
Project1_2022-06-16_11-33-34.png (36.32 KiB) Viewed 4537 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

Post Reply