Logarithmic axis again

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
walker1
Newbie
Newbie
Posts: 14
Joined: Fri Nov 15, 2002 12:00 am
Location: Denmark

Logarithmic axis again

Post by walker1 » Wed Feb 13, 2008 1:46 pm

When I select logarithmic Y axis on a standard XY chart I seem only to get labels for the upper most decade. (all numbers 1 to 10)

I then get minor ticks for the next (no grid lines) and then ... nothing.

Which of the two zillion parameters could change this ?

I don't need a label for every tick, but at least the decades would be nice.

Or should we just switch to dB, where the linear scale works just fine. :roll:

I am using ver. 7.12.

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

Post by Narcís » Wed Feb 13, 2008 2:35 pm

Hi ole,

You can achieve what you request using this code:

Code: Select all

  Chart1.Axes.Left.LabelsSeparation:=0;
  Chart1.Axes.Left.Increment:=10;
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

walker1
Newbie
Newbie
Posts: 14
Joined: Fri Nov 15, 2002 12:00 am
Location: Denmark

Post by walker1 » Thu Feb 14, 2008 6:24 am

Sorry, but not too good :(

With those parameters I get many more labels, but they keep on going in increments of 10.
I.e. 80, 90, 100, 110, 120, 130 and so on. It is a slow death going all the way up to 1000 :roll:
I am using the right axis, but I guess left and right will do the same given the same parameters.

How about having nice decades 1, 10, 100, 1000 with a normal logarithmic grid in between ?
I have a scale working somewhat like that in polar, but only some strange linear grid, and as can be seen in another topic in here, there is a problem with scaling of the plotted data on that.
( http://www.teechart.net/support/viewtopic.php?t=7334 )

The picture shows log scale from 1 to 1000 with increment= 1.
Logarithmic, yes, but 3 decades with only 30 grid lines would be a lot more useful than all 1000! :evil:
Image

And, unfortunately, Ole is not here any more. I am just using his account, as I have to work on his code.
Have just figured out how to update the profile, though. Don't know yet, if it will have any influence on this post.

Privately I am member of another forum, that uses the same engine, so at least the environment in here is somewhat familiar ;)

xxxxxx
Advanced
Posts: 128
Joined: Tue Jun 19, 2007 12:00 am
Location: Russia
Contact:

Post by xxxxxx » Thu Feb 14, 2008 10:03 am

If you don't need too big zoom it could help using TChartAxis.Items property with 30 items at 1,2,3,...,10,20,30,...,100,200,300...1000
Regards, Alexander
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009

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

Post by Narcís » Mon Feb 18, 2008 5:09 pm

Hi walker1,

As Alexander suggests, to have labels and grid lines to appear per your request you should use custom axis labels. You can find an example at TeeChart's features demo. The example can be found at All Features\Welcome!\Axes\Labels\Custom Labels.
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

walker1
Newbie
Newbie
Posts: 14
Joined: Fri Nov 15, 2002 12:00 am
Location: Denmark

Post by walker1 » Mon Mar 10, 2008 12:37 pm

narcis wrote:Hi walker1,

As Alexander suggests, to have labels and grid lines to appear per your request you should use custom axis labels. You can find an example at TeeChart's features demo. The example can be found at All Features\Welcome!\Axes\Labels\Custom Labels.
Sounds like it might be an idea, but where do I find it ? :oops:

I have found several hits to it when searching the site, but not the actual file/code.
He, who does not ask, gets no answer!

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

Post by Narcís » Mon Mar 10, 2008 2:12 pm

Hi walker1,

New features demo is available at TeeChart's program group created by the binary installers, not the source code installer. Also, with the binary installers you'll find the full project at the TeeNew folder in the Examples section created by the installer.
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

walker1
Newbie
Newbie
Posts: 14
Joined: Fri Nov 15, 2002 12:00 am
Location: Denmark

Post by walker1 » Tue Mar 11, 2008 7:56 am

Great!
Found the demo with an older 6 or 7.-something version.

I now have a fairly good log scale spaning several decades, if I want to.

As my scale may change at run time, I will have to come up with an algorithm to put in reasonable ticks, but this was the break needed! :cool:
He, who does not ask, gets no answer!

Post Reply