Page 1 of 1

Logarithmic axis again

Posted: Wed Feb 13, 2008 1:46 pm
by 9334165
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.

Posted: Wed Feb 13, 2008 2:35 pm
by narcis
Hi ole,

You can achieve what you request using this code:

Code: Select all

  Chart1.Axes.Left.LabelsSeparation:=0;
  Chart1.Axes.Left.Increment:=10;

Posted: Thu Feb 14, 2008 6:24 am
by 9334165
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 ;)

Posted: Thu Feb 14, 2008 10:03 am
by 9047589
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

Posted: Mon Feb 18, 2008 5:09 pm
by narcis
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.

Posted: Mon Mar 10, 2008 12:37 pm
by 9334165
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.

Posted: Mon Mar 10, 2008 2:12 pm
by narcis
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.

Posted: Tue Mar 11, 2008 7:56 am
by 9334165
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: