Search code examples
delphiteechart

TeeChart non-transparent Mark for a Transparent Series - is it possible?


Delphi 10.1 Pro, VCL with embedded TeeChart.

I've a 75% transparent AreaSeries and I would like its Marks to be non transparent, or The font to be non transparent.

I tried the following without a success:

Marks[0].Transparent := false; // <- DOESN'T HELP
Marks[0].Transparency:= 0;     // <- DOESN'T HELP

The tAreaSeries and its Marks are created as follow:

procedure TForm2.AddAreaSeries(aMin, aMax, aSeriesTransparency: integer);
begin
  with Chart1.AddSeries(tAreaSeries) as tAreaSeries do
    begin
      AddXY(aMin, 10); // Two point AreaSeries
      AddXY(aMax, 10);
      SeriesColor  := clGreen;
      Transparency := aSeriesTransparency; // <- Series Transparency

      Marks[0].Color       := clRed;
      Marks[0].Transparent := false; // <- DOESN'T HELP
      Marks[0].Transparency:= 0;     // <- DOESN'T HELP

      Marks[0].Visible     := true;
      Marks[1].Visible     := true;
      Marks.Visible        := true; // Global Visibility for all Markers
    end;
end;

For demonstration, I called the above twice, one non transparent (0%) and the other with 75% transparency:

procedure TForm2.FormCreate(Sender: TObject);
begin
  Chart1.View3D := false;
  Chart1.Axes.Bottom.SetMinMax(0,10);

  // Adding two AreaSeries
  AddAreaSeries(1, 4, 0);  // Non transparent AreaSeries
  AddAreaSeries(6, 9, 75); // 75% transparent AreaSeries
end;

Here is the screen shot with comments on it: enter image description here

Thanks for any help.


Solution

  • The Marks for a Series have an boolean option UseSeriesTransparency that you just need to set to false to set transparency independent of the series.

      Series2.Marks.UseSeriesTransparency := false; 
    

    In the UI the option is a checkbox.

    enter image description here