Title‘s Colors in ChartListBox

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
xsLiu
Newbie
Newbie
Posts: 33
Joined: Wed May 22, 2019 12:00 am

Title‘s Colors in ChartListBox

Post by xsLiu » Wed Sep 30, 2020 2:01 am

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 18103 times

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

Re: Title‘s Colors in ChartListBox

Post by Yeray » Wed Sep 30, 2020 9:16 am

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 18095 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.
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

xsLiu
Newbie
Newbie
Posts: 33
Joined: Wed May 22, 2019 12:00 am

Re: Title‘s Colors in ChartListBox

Post by xsLiu » Thu Oct 01, 2020 3:00 am

Please find attached.
Point3D.jpg
Point3D.jpg (66.09 KiB) Viewed 18087 times
Attachments
Point3D.zip
(54.15 KiB) Downloaded 1183 times

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

Re: Title‘s Colors in ChartListBox

Post by Yeray » Thu Oct 01, 2020 6:30 am

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.
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

xsLiu
Newbie
Newbie
Posts: 33
Joined: Wed May 22, 2019 12:00 am

Re: Title‘s Colors in ChartListBox

Post by xsLiu » Mon Sep 27, 2021 4:41 am

How to change the Color tag/band (between ActiveCheck and SeriesTitle) from “square” to “line”?

xsLiu
Newbie
Newbie
Posts: 33
Joined: Wed May 22, 2019 12:00 am

Re: Title‘s Colors in ChartListBox

Post by xsLiu » Mon Sep 27, 2021 9:02 am

How to change the Color tag/band (between ActiveCheck and SeriesTitle) from “square” to “line”?
Please find the attached file and the hand tag.
Attachments
pp.png
pp.png (15.67 KiB) Viewed 13243 times

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

Re: Title‘s Colors in ChartListBox

Post by Yeray » Mon Sep 27, 2021 9:36 am

Hello,

Depending on the series style it will be changing the Series' Pointer.Color, or just the Series' Color. Ie

Code: Select all

TBarSeries(Chart1[0]).Color:=clRed;

Code: Select all

TPoint3DSeries(Chart1[0]).Pointer.Color:=clRed;
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

xsLiu
Newbie
Newbie
Posts: 33
Joined: Wed May 22, 2019 12:00 am

Re: Title‘s Colors in ChartListBox

Post by xsLiu » Mon Sep 27, 2021 2:00 pm

I want to change its shape shown in the ChartListBox, not color.

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

Re: Title‘s Colors in ChartListBox

Post by Yeray » Mon Sep 27, 2021 5:05 pm

Hello,

Ups. :oops:
In that case you could use a dummy TLineSeries - which symbol is drawn as a "line" when in 2D - and hide the TBarSeries - which is drawn as a "square" when in 2D - from the legend and editor. Ie:

Code: Select all

uses Series;

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

  Chart1.Gradient.Visible:=False;
  Chart1.Color:=clWhite;
  Chart1.Walls.Back.Visible:=False;
  Chart1.Walls.Back.Color:=clWhite;

  with Chart1.AddSeries(TBarSeries) do
  begin
    FillSampleValues;
    ShowInLegend:=False;
    ShowInEditor:=False;
    Title:='Series1';
  end;

  //dummy series for the legend
  with Chart1.AddSeries(TLineSeries) do
  begin
    Title:=Chart1[0].Title;
    Color:=Chart1[0].Color;
  end;

  with Chart1.AddSeries(TLineSeries) do
  begin
    FillSampleValues;
    Title:='Series2';
  end;

  ChartListBox1.Chart:=Chart1;
end;
chartlist_dummy_symbol.png
chartlist_dummy_symbol.png (13.07 KiB) Viewed 13228 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