Page 1 of 1

zooming, how to get range of visible values

Posted: Fri Apr 20, 2007 5:19 am
by 8571714
hello,

like in topic - how could i get range of visible values on axes after zoom ?


thanks in advance

Posted: Fri Apr 20, 2007 1:38 pm
by narcis
Hi guzial,

You could do something like this:

Code: Select all

procedure TForm1.Chart1Zoom(Sender: TObject);
begin
  ShowVisibleIndexes;
end;

procedure TForm1.ShowVisibleIndexes;
begin
  Chart1.Draw;
  Chart1.Title.Text.Clear;
  Chart1.Title.Text.Add(IntToStr(Series1.FirstDisplayedIndex));
  Chart1.Title.Text.Add(IntToStr(Series1.FirstDisplayedIndex + Series1.VisibleCount-1));
end;

procedure TForm1.Chart1UndoZoom(Sender: TObject);
begin
  ShowVisibleIndexes;
end;