Page 1 of 1

Contour Levels Pen Editor

Posted: Mon Nov 28, 2022 10:02 am
by 16592554
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.

Re: Contour Levels Pen Editor

Posted: Tue Nov 29, 2022 8:38 am
by yeray
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;