rotate with slider

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Jennifer
Newbie
Newbie
Posts: 20
Joined: Tue Dec 07, 2004 5:00 am

rotate with slider

Post by Jennifer » Fri Dec 10, 2004 9:46 pm

Hi-

We installed the trotatetool, and it worked, but what we want to do is
do rotate,elevation, etc just like in the chart edit 3D panel. That is, the rotate slider rotates, etc. we do not want to use the mouse other than
to move a slider. If there are a couple of code snippets available, that
would be fine. We do not mind working on source code and picking
it out if thats the way.

Sorry about the confusion here.

Jennifer

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Mon Dec 13, 2004 7:25 am

Hi, Jeniffer.

All you have to do is connect slider value to appopriate Aspect3D properties and define minimum and maximum value for each slider. For example, if you want to control the rotation angle, the following code should work fine:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D := True;
  Chart1.Aspect.Orthogonal := False;

  ScrollBarRot.Min := 0;
  ScrollBarRot.Max := 360;
  ScrollBarRot.Position := Chart1.Aspect.Rotation;
end;

procedure TForm1.ScrollBarRotChange(Sender: TObject);
begin
  Chart1.Aspect.Rotation := ScrollBarRot.Position;
end;

Marjan Slatinek,
http://www.steema.com

Post Reply