Recent

Author Topic: [ANSWERED]Questions about TALegendPanel  (Read 548 times)

CM630

  • Hero Member
  • *****
  • Posts: 1676
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
[ANSWERED]Questions about TALegendPanel
« on: February 20, 2026, 08:40:06 am »
I have some questions about TALegendPanel.
1. Is it posible to have the titles of the series on the left side of the icon in TALegendPanel?
2. The legend itself is aligned to the right inside the control area. Can it be placed on the left side?
3. Is it possible the legend to occupy the entire width of its area (the rectangle in which it is displayed to be as wide as the borders of the cotrols are)?



« Last Edit: February 20, 2026, 04:02:48 pm by CM630 »
Лазар 4,4 32 bit (sometimes 64 bit); FPC3,2,2

wp

  • Hero Member
  • *****
  • Posts: 13486
Re: Questions about TALegendPanel:
« Reply #1 on: February 20, 2026, 12:22:17 pm »
1. no
2. no
3. no

Why don't you use the builtin-legend of the chart (Chart.Legend.Visible := true)? I don't know a good argument for the ChartLegendPanel which maybe exists only for historical reasons. Besides the issues that you mention the ChartLegendPanel is not an integral part of the chart and thus is neglected when the chart is printed or saved to file.

CM630

  • Hero Member
  • *****
  • Posts: 1676
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
[ANSWERED] Questions about TALegendPanel:
« Reply #2 on: February 20, 2026, 02:41:48 pm »
Thanks.
I need a legend that is looks in a very specific way, so I decided to make a legend from scratch.
Лазар 4,4 32 bit (sometimes 64 bit); FPC3,2,2

wp

  • Hero Member
  • *****
  • Posts: 13486
Re: [ANSWERED]Questions about TALegendPanel
« Reply #3 on: February 20, 2026, 04:09:17 pm »
You can completely owner-draw the legend (event Chart.OnDrawLegend). See sample in components/tachart/demo/legend of the Lazarus installation, OwnerDrawFrame (https://wiki.lazarus.freepascal.org/TAChart_Demos#legend).

 

TinyPortal © 2005-2018