Hide label text

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Marius
Newbie
Newbie
Posts: 28
Joined: Tue Jul 29, 2008 12:00 am

Hide label text

Post by Marius » Fri Sep 04, 2009 8:39 am

I have a financial chart where I sometimes add another chart at the bottom with volume information. This volume chart has its own left axis which is created at runtime. Now I have a requirement to remove the labels on this Axis. Everything else shuold be the same (ticks, grid lines etc). I have tried the following where I hoped the last statement would remove the labels but it also removed the grid lines etc. Any ideas?

Code: Select all

  chCustom.CustomAxes.Add;
  FaxVolumeAxis := chCustom.CustomAxes[chCustom.CustomAxes.Count-1];
  FaxVolumeAxis.StartPosition := FNextAxisEnd - 18;
  FaxVolumeAxis.EndPosition   := FNextAxisEnd;
  FaxVolumeAxis.Automatic := true;
  FaxVolumeAxis.Grid.Visible := true;
  FaxVolumeAxis.MinorTickCount := 0;
  FaxVolumeAxis.OtherSide := false;
  FaxVolumeAxis.Axis.Width := 1;
  FaxVolumeAxis.Labels := false;  //  <<<----- remove labels
BRgds
Marius

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Hide label text

Post by Narcís » Fri Sep 04, 2009 8:49 am

Hi Marius,

In that case you can set labels to a blank space in the OnGetAxisLabel event, for example:

Code: Select all

procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
  Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
  if Sender=Chart1.Axes.Left then
    LabelText:=' ';
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Marius
Newbie
Newbie
Posts: 28
Joined: Tue Jul 29, 2008 12:00 am

Re: Hide label text

Post by Marius » Fri Sep 04, 2009 8:54 am

Hi Narcis

Not very practical as this is one of several axis I could be adding at runtime. Is there not a property I could set or change the font size or something like that?

Marius

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Hide label text

Post by Narcís » Fri Sep 04, 2009 9:00 am

Hi Marius,

You could set their colour to be the same as TChart's colour, for example:

Code: Select all

  Chart1.Axes.Left.LabelsFont.Color:=Chart1.Color;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Marius
Newbie
Newbie
Posts: 28
Joined: Tue Jul 29, 2008 12:00 am

Re: Hide label text

Post by Marius » Fri Sep 04, 2009 9:08 am

Thanks

That does the trick

Marius

Post Reply