Page 1 of 1

Bottom axis label increment issue

Posted: Tue Feb 01, 2005 8:25 pm
by 9340003
In a chart with two series (one has several points, the other has perhaps two points), the bottom axis behavior is incorrect. This is most noticable when the x values are in the range of 0 to 1. The culprit seems to be the AnySeriesHasLessThan function, which causes CalcLabelsIncrement to return 1, resulting in just two axis labels (0 and 1). This get much worse when the actual values are perhaps between 0.2 and 0.8, where one will see absolutely no labels.
Commenting out the ill effect of AnySeriesHasLessThan seems to solve the problem.
I assume that there is a good reason to keep AnySeriesHasLessThan around, I just do not know how to fix it so it behaves with x values between 0 and 1 (or any other similar range).
Interestingly, the left axis doesn't come with the same shortcoming.

Posted: Thu Feb 03, 2005 11:14 am
by Marjan
Hi, Thomas.

Yes, you're correct. A fix is to replace:

Code: Select all

if AnySeriesHasLessThan(MaxNumLabels) then
  result:=Math.Max(1,result);
with

Code: Select all

if (IRange>=1) and AnySeriesHasLessThan(MaxNumLabels) then
  result:=Math.Max(1,result);
If you don't have TeeChart source code you can also do it manually:
#1 : Check if axis range is less or equal to 1.0
#2 : if yes, manually set axis increment.

Posted: Thu Feb 03, 2005 10:09 pm
by 9340003
Thanks Marjan,
I knew that the AnySeriesHasLessThan was good for something, just had no time to figure out the details. Wil fix my source code :)