Logarithmic axis - labels disappearing?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
vinc64
Newbie
Newbie
Posts: 30
Joined: Fri Jan 23, 2009 12:00 am

Logarithmic axis - labels disappearing?

Post by vinc64 » Wed May 04, 2011 3:22 pm

Hi,

When I select Logarithmic in the editor for the left axis then the labels don't appear (on left axis), please refer to attached pictures of the same chart. The increment is 20 and except for Logarithmic all other options are the same (between the two pictures of the graph). How do I get the labels to appear without using draw all labels (as this would show too many labels).

Regards,
Vincenzo
Attachments
log_not_selected.jpg
Logarithmic not selected for left axis.
log_not_selected.jpg (45.11 KiB) Viewed 4434 times
Log_Selected.jpg
Logarithmic left axis selected
Log_Selected.jpg (44.6 KiB) Viewed 4421 times

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

Re: Logarithmic axis - labels disappearing?

Post by Yeray » Thu May 05, 2011 9:27 am

Hello Vincenzo,

I see in your left axis that the values in your series are from about 100 to about 250. In a base 10 logarithmic scale, the values are ..., 0.01, 0.1, 1, 10, 100,... So with your values, only the 100 label should be drawn in that scale.
I'm trying this with the following code:

Code: Select all

uses Series;

var Series1: TFastLineSeries;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;

  Series1:=Chart1.AddSeries(TFastLineSeries) as TFastLineSeries;
  Series1.Add(100);
  Series1.Add(225);
  Series1.Add(150);
  Series1.Add(200);
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
  Chart1.Axes.Left.Logarithmic:=CheckBox1.Checked;
end;
And I'm obtaining the expected result when the checkbox is active:
Image
And adding some extra values to have a bigger range the result is also the expected:

Code: Select all

  Series1.Add(0.5);
  Series1.Add(2000);
Image

On the other hand, if you want you can change the LogarithmicBase to set another logarithmic scale or you can use Custom labels as in the example at "All features\Welcome !\Axes\Labels\Custom Labels" in the features demo program included with the installation.

If you still have problems with it, please arrange a simple example project we can run as-is to reproduce the problem here.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
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

vinc64
Newbie
Newbie
Posts: 30
Joined: Fri Jan 23, 2009 12:00 am

Re: Logarithmic axis - labels disappearing?

Post by vinc64 » Thu May 05, 2011 10:25 am

Hi Alonso,

Thanks for the explanation, for now that should be ok for me to proceed.

Regards,
Vincenzo

Post Reply