Hide Axis Labels

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bertrod
Advanced
Posts: 151
Joined: Wed Sep 07, 2005 4:00 am

Hide Axis Labels

Post by bertrod » Thu Jun 08, 2006 2:49 pm

Hello,

Is it possible to have only the graduation of an axis, and not the labels ? I would like to hide the labels or customize them without touching the graduation.

This would be an exemple of what i would like to do :

Image

Pep
Site Admin
Site Admin
Posts: 3299
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Jun 09, 2006 10:24 am

Hi,

one way to do this would be to make invisible the non desired axis labels using the OnGetAxisLabel event, using similar code to the following :

Code: Select all

    procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
        Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
    begin
        if Sender = Chart1.axes.left then
            Labeltext := ' '
    end;
Here you can customize which ones can be showed,.. or simply hide all and then use the Canvas TextOut methid to display the labels you want.

bertrod
Advanced
Posts: 151
Joined: Wed Sep 07, 2005 4:00 am

Post by bertrod » Mon Jun 12, 2006 2:51 pm

Thanks, I didn't find this method. 8)

Post Reply