IW

TMS IntraWeb Charts

Fast multipane financial graphs & 2D feature rich charting

Also available for:



Tips and Frequently Asked Questions

 Programmatically scrolling and zooming in the chart


Scrolling and zooming via code in the chart is simple. This is just a matter of programmatically changing the properties Pane.Range.RangeFrom and Pane.Range.RangeTo. To illustrate this, we create a single sinus serie in a chart and add 4 buttons to control the scrolling & zooming:

Initialization of the chart:
procedure TForm1.FormCreate(Sender: TObject);
var
  i: integer;
begin
  advchartview1.BeginUpdate;
  advchartview1.Panes.Clear;
  advchartview1.Panes.Add;
  advchartview1.Panes[0].Options := advchartview1.Panes[0].Options + [poMoving, poHorzScroll, poHorzScale];
  advchartview1.Panes[0].Series.Add;

  with advchartview1.Panes[0].Series[0] do
  begin
    for i := 1 to 200 do
      AddSinglePoint(50 * sin(i/20*PI));
  end;
  advchartview1.Panes[0].Series[0].AutoRange := arCommon;
  advchartview1.Panes[0].Range.RangeFrom := 0;
  advchartview1.Panes[0].Range.RangeTo := 200;

  advchartview1.EndUpdate;
end;
Code to perform zoom and scroll:
procedure TForm1.Scroll(delta: integer);
begin
  advchartview1.BeginUpdate;
  advchartview1.Panes[0].Range.RangeFrom :=   advchartview1.Panes[0].Range.RangeFrom + delta;
  advchartview1.Panes[0].Range.RangeTo :=   advchartview1.Panes[0].Range.RangeTo + delta;
  advchartview1.EndUpdate;
end;

procedure TForm1.Zoom(delta: integer);
begin
  advchartview1.BeginUpdate;
  advchartview1.Panes[0].Range.RangeFrom :=   advchartview1.Panes[0].Range.RangeFrom + delta;
  advchartview1.Panes[0].Range.RangeTo :=   advchartview1.Panes[0].Range.RangeTo - delta;
  advchartview1.EndUpdate;
end;
The code to zoom and scroll can then simply be attached to buttons:
procedure TForm1.ScrollLeftClick(Sender: TObject);
begin
  Scroll(-10);
end;

procedure TForm1.ScrollRightClick(Sender: TObject);
begin
  Scroll(+10);
end;

procedure TForm1.ZoomOutClick(Sender: TObject);
begin
  Zoom(+10);
end;

procedure TForm1.ZoomInClick(Sender: TObject);
begin
  Zoom(-10);
end;


IW

Single developer license


license for 1 developer
€ 70 yearly renewal *
€ 125


order now
add to cart

Small team license


license for 2 developers
€ 115 yearly renewal *
€ 195


order now
add to cart

Site license


unlimited developers in the company
€ 295 yearly renewal *
€ 495


order now
add to cart

CreditCards and PayPal Accepted


Compatibility

    Delphi 7, 2007, 2010, 2009, XE, XE2, XE3, XE4, XE5, XE6, XE7, XE8, 10 Seattle, 10.1 Berlin, 10.2 Tokyo, 10.3 Rio, 10.4 Sydney, 11 Alexandria, C++Builder 2007, 2009, 2010, XE, XE2, XE3, XE4, XE5, XE6, XE7, XE8, 10 Seattle, 10.1 Berlin, 10.2 Tokyo, 10.3 Rio, 10.4 Sydney, 11 Alexandria, DXE15, CXE15 (Professional/Enterprise/Architect)


Licensing

Bookmarks