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.
Bottom axis label increment issue
Hi, Thomas.
Yes, you're correct. A fix is to replace:
with
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.
Yes, you're correct. A fix is to replace:
Code: Select all
if AnySeriesHasLessThan(MaxNumLabels) then
result:=Math.Max(1,result);
Code: Select all
if (IRange>=1) and AnySeriesHasLessThan(MaxNumLabels) then
result:=Math.Max(1,result);
#1 : Check if axis range is less or equal to 1.0
#2 : if yes, manually set axis increment.
Marjan Slatinek,
http://www.steema.com
http://www.steema.com