Page 1 of 1

The TChartSeries.VisibleCount returns a twice greater result

Posted: Mon Feb 28, 2011 3:38 am
by 10551422
Hello. I use TeeChart Pro v2010.02.20202 Win32. The TChartSeries.VisibleCount returns wrong result (twice greater value). The example is in the attachment
test.zip
(1.86 KiB) Downloaded 246 times
.

Re: The TChartSeries.VisibleCount returns a twice greater result

Posted: Mon Feb 28, 2011 1:06 pm
by yeray
Hi actforex,

I've seen that the function had an "else" missing:

Code: Select all

Function TChartSeries.VisibleCount:Integer;
var i: Integer;
Begin
  result:=0;

  if ((FFirstVisibleIndex=0) and (FLastVisibleIndex=Count-1)) then
    result:=Count
  else // <- correction
  if ((FFirstVisibleIndex<>-1) and (FLastVisibleIndex<>-1)) then
  begin
    if NotMandatoryValueList.Order = loNone then
    begin
      for i:=0 to Count-1 do
        if (XValue[i] >= GetHorizAxis.Minimum) and (XValue[i] <= GetHorizAxis.Maximum) and
           (YValue[i] >= GetVertAxis.Minimum) and (YValue[i] <= GetVertAxis.Maximum) then
          Inc(result);
    end
    else
    begin
      for i:=FFirstVisibleIndex to FLastVisibleIndex do
        if (MandatoryValueList.Value[i] >= MandatoryAxis.Minimum) and (MandatoryValueList.Value[i] <= MandatoryAxis.Maximum) then
          Inc(result);
    end;
  end;
end;
The correction will be included in the next maintenance release. If you are a source code customer, you can modify your sources.