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: 10
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 19654 times

Yeray
Site Admin
Site Admin
Posts: 9622
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 19635 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

yk.kim
Newbie
Newbie
Posts: 10
Joined: Mon Mar 18, 2024 12:00 am

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

Post by yk.kim » Thu Oct 31, 2024 2:12 am

Does the TLegendPaletteTool presented above exist in the javascript library?
I would like to inquire about how to implement the above example using Javascript.

Yeray
Site Admin
Site Admin
Posts: 9622
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 » Thu Oct 31, 2024 8:16 am

Hello,

Oups sorry for the confusion! I'll take a look at the js library.
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

Yeray
Site Admin
Site Admin
Posts: 9622
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 » Thu Oct 31, 2024 8:44 am

Hello,

I see you asked something very similar a few months ago.
https://www.steema.com/support/viewtopi ... 18&t=18141
Weren't you able to make it work?

The only difference I see is in the alignment of the legend. Am I missing anything else?
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

yk.kim
Newbie
Newbie
Posts: 10
Joined: Mon Mar 18, 2024 12:00 am

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

Post by yk.kim » Sun Nov 03, 2024 11:46 pm

https://www.steema.com/support/viewtopi ... 18&t=18141

I would like to contact you because the legend does not display the way
I want even if I change the position of the legend to "bottom" in the source link above.
Attachments
주석 2024-11-04 084543.png
주석 2024-11-04 084543.png (14.83 KiB) Viewed 17697 times

Yeray
Site Admin
Site Admin
Posts: 9622
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 Nov 04, 2024 9:39 am

Hello,

You could try adding a second chart at the bottom and use it to draw the legend. Ie:
https://jsfiddle.net/norike82/7aj5p9of/
colorGridLegend.png
colorGridLegend.png (47.05 KiB) Viewed 17489 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

yk.kim
Newbie
Newbie
Posts: 10
Joined: Mon Mar 18, 2024 12:00 am

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

Post by yk.kim » Mon Nov 04, 2024 11:16 pm

Yeray wrote:
Mon Nov 04, 2024 9:39 am
Hello,

You could try adding a second chart at the bottom and use it to draw the legend. Ie:
https://jsfiddle.net/norike82/7aj5p9of/

colorGridLegend.png
Thank you for suggesting a solution. :D

Post Reply