Contour Levels Pen Editor

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Paul Holden
Newbie
Newbie
Posts: 11
Joined: Wed Dec 01, 2021 12:00 am

Contour Levels Pen Editor

Post by Paul Holden » Mon Nov 28, 2022 10:02 am

I am trying to use the components in VCLTee.TeePenDlg to make a contour levels editor for a TContourSeries. All works fine except for the pen color, which has no effect. Why is this and is there a way to way to set the contour level line color with these controls?

Edit: The problem seems to be contour series that are marked as DefaultPen. I have gotten around the issue by creating my own version of the TeePenDlg, that works on a TContourLevel.

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

Re: Contour Levels Pen Editor

Post by Yeray » Tue Nov 29, 2022 8:38 am

Hello,

You can use the LinesColor property, but note this is only used to draw the lines when Filled.
In the following example I dropped a TChart (Chart1), a TCheckBox (CheckBoxFilled) and a TButtonColor (ButtonColorLines):

Code: Select all

var ContourSeries: TContourSeries;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=False;
  Chart1.Legend.Hide;

  ContourSeries:=TContourSeries(Chart1.AddSeries(TContourSeries));
  ContourSeries.FillSampleValues;

  CheckBoxFilled.Checked:=ContourSeries.Filled;
  ButtonColorLines.LinkProperty(ContourSeries, 'LinesColor');

  CheckBoxFilledClick(Self);
end;

procedure TForm1.CheckBoxFilledClick(Sender: TObject);
begin
  ContourSeries.Filled:=CheckBoxFilled.Checked;
  ButtonColorLines.Enabled:=ContourSeries.Filled;
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

Post Reply