I would like to inquire about how to apply a legend to a ColorGrid chart.

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
yk.kim
Newbie
Newbie
Posts: 5
Joined: Mon Mar 18, 2024 12:00 am

I would like to inquire about how to apply a legend to a ColorGrid chart.

Post by yk.kim » Mon Oct 28, 2024 4:43 am

I would like to inquire about how to apply a legend to a ColorGrid chart as shown in the attached image.
thank you.
Attachments
주석 2024-10-28 134007.png
주석 2024-10-28 134007.png (25.94 KiB) Viewed 220 times

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

Re: I would like to inquire about how to apply a legend to a ColorGrid chart.

Post by Yeray » Mon Oct 28, 2024 9:23 am

Hello,

Have you tried the TLegendPaletteTool?
Here a simple example:

Code: Select all

uses Chart, TeeSurfa, TeeLegendPalette;

var Chart1: TChart;

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

  with Chart1 do
  begin
    Parent:=Self;
    Align:=alClient;
    Color:=clWhite;
    Gradient.Visible:=False;
    Walls.Back.Color:=clWhite;
    Walls.Back.Gradient.Visible:=False;
    Legend.Hide;
    View3D:=False;
    MarginBottom:=10;

    AddSeries(TColorGridSeries).FillSampleValues;

    Draw;

    with TLegendPaletteTool(Tools.Add(TLegendPaletteTool)) do
    begin
      Series:=Chart1[0];
      Vertical:=False;
      Width:=Chart1.Width;
      Height:=40;
      Top:=Chart1.Axes.Bottom.PosAxis+25;
      Axis:=laDefault;
    end;
  end;
end;
horiz_legendpalette.png
horiz_legendpalette.png (16.09 KiB) Viewed 201 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