Page 1 of 1

Getting visible value range after zooming problem

Posted: Tue Jan 20, 2009 6:28 pm
by 10548367
I am trying to get the visible value range after zooming on a TLineSeries. This is my current code:

Chart1.Draw;
Chart1.Title.Text.Clear;
Chart1.Title.Text.Add(IntToStr(Series1.FirstDisplayedIndex));
Chart1.Title.Text.Add(IntToStr(Series1.FirstDisplayedIndex + Series1.VisibleCount-1));

I get the correct answer for start value (Series1.FirstDisplayedIndex), but the end value is not correct (Series1.FirstDisplayedIndex + Series1.VisibleCount-1). I am using TeeChart Pro v8.02.10861 Win32.

Any suggestions?

Posted: Wed Jan 21, 2009 8:24 am
by narcis
Hi Booner12,

First of all please notice that current TeeChart Pro v8 VCL release is v8.04. Using it I see that VisibleCount is wrong and added the defect (TV52013762) to the bug list to be fixed. In the meantime, using code below works fine for me here.

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
  Caption:=IntToStr(Series1.FirstDisplayedIndex) + ', ' +
            IntToStr(Series1.FirstDisplayedIndex+Series1.VisibleCount-2);
end;