The TChartSeries.VisibleCount returns a twice greater result

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
actforex
Newbie
Newbie
Posts: 3
Joined: Fri Jan 09, 2009 12:00 am

The TChartSeries.VisibleCount returns a twice greater result

Post by actforex » Mon Feb 28, 2011 3:38 am

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 245 times
.

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: The TChartSeries.VisibleCount returns a twice greater result

Post by Yeray » Mon Feb 28, 2011 1:06 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply