Page 1 of 1

Title‘s Colors in ChartListBox

Posted: Wed Sep 30, 2020 2:01 am
by 16586272
I hope to show Titles using the same Color with its corresponding Series in a ChartListBox, but Title‘s Color is not consistent with SeriesColor in ChartListBox.

Code: Select all

  with aChartListBox do
    begin
      Chart := aChart;
      EnableChangeType := false;
      EnableChangeColor := true;
      EnableDragSeries := false;
      ShowSeriesIcon := false;
      ShowActiveCheck := true;
      ShowSeriesColor := true;
      ShowSeriesTitle := true;
      FontSeriesColor := true;
      AllowDeleteSeries := false;
      AllowAddSeries := false;
    end;
Color.jpg
Color.jpg (5.35 KiB) Viewed 2176 times

Re: Title‘s Colors in ChartListBox

Posted: Wed Sep 30, 2020 9:16 am
by yeray
Hello,

It seems to work fine for me here:
Project1_2020-09-30_11-15-02.png
Project1_2020-09-30_11-15-02.png (14.41 KiB) Viewed 2168 times

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var Chart1: TChart;
    ChartListBox1: TChartListBox;
begin
  Chart1:=TChart.Create(Self);
  ChartListBox1:=TChartListBox.Create(Self);

  with Chart1 do
  begin
    Parent:=Self;
    View3D:=False;
    AddSeries(TBarSeries).FillSampleValues;
    with TLineSeries(AddSeries(TLineSeries)) do
    begin
      FillSampleValues;
      Pen.Width:=2;
    end;
  end;

  with ChartListBox1 do
  begin
    Parent:=Self;
    Left:=Chart1.Width;
    Chart := Chart1;
    EnableChangeType := false;
    EnableChangeColor := true;
    EnableDragSeries := false;
    ShowSeriesIcon := false;
    ShowActiveCheck := true;
    ShowSeriesColor := true;
    ShowSeriesTitle := true;
    FontSeriesColor := true;
    AllowDeleteSeries := false;
    AllowAddSeries := false;
  end;
end;
If you still find problems with it, please arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.

Re: Title‘s Colors in ChartListBox

Posted: Thu Oct 01, 2020 3:00 am
by 16586272
Please find attached.
Point3D.jpg
Point3D.jpg (66.09 KiB) Viewed 2160 times

Re: Title‘s Colors in ChartListBox

Posted: Thu Oct 01, 2020 6:30 am
by yeray
Hello,

You are setting the series LinePen.Color, which is ok for the lines connecting the 3d points, but you should set the main series' Color.