TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
Marius
- Newbie
- Posts: 28
- Joined: Tue Jul 29, 2008 12:00 am
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
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
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;
-
Marius
- Newbie
- Posts: 28
- Joined: Tue Jul 29, 2008 12:00 am
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
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
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;
-
Marius
- Newbie
- Posts: 28
- Joined: Tue Jul 29, 2008 12:00 am
Post
by Marius » Fri Sep 04, 2009 9:08 am
Thanks
That does the trick
Marius