how to rotate charts with mouse?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
davids
Newbie
Newbie
Posts: 13
Joined: Wed Dec 10, 2003 5:00 am
Location: Phoenix, AZ

how to rotate charts with mouse?

Post by davids » Fri Jul 23, 2004 12:33 am

In the TeeCommander panel, there's a button that lets you rotate the charts with the mouse. I want to add this to a chart without requiring the TeeCommander panel. What is needed to do this?

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Jul 23, 2004 6:26 am

Hi David,

this functionality can be added adding the Rotate Tool to the Chart.

davids
Newbie
Newbie
Posts: 13
Joined: Wed Dec 10, 2003 5:00 am
Location: Phoenix, AZ

Post by davids » Fri Jul 23, 2004 10:25 pm

hmmm.... and where might the "Rotate Tool" reside? (I've got TChart 7) I have nothing on my component toolbar that has the word "rotate" in it, or on the TeeChart tab. (I've got TeeCommander...)

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Sun Jul 25, 2004 12:01 pm

Hi David,
to add the Rotate tool at design time you must edit the Chart (double click on it), go to the Tools Tab and click "Add" button, go to the Other tab and you will see it.
Or you can always add it at runtime using :
uses TeeTools;
Chart1.Tools.Add(TrotateTool.Create(self));

davids
Newbie
Newbie
Posts: 13
Joined: Wed Dec 10, 2003 5:00 am
Location: Phoenix, AZ

Post by davids » Mon Jul 26, 2004 10:23 pm

Sorry, I guess I'm not being clear. I want to add a button and/or menu item to my application that behaves like the button on TeeCommander, so that when you depress it, you can use the mouse to rotate the chart in 3D mode. We're trying to AVOID using the chart editor because our users tend to find it far too complex and intimidating. So I'm identifying commonly used chart functions and adding them to our toolbar and menus.

I looked at the code in TeeCommander, and it appears to implement the panning, rotating, and similar functions, entirely within the OnMouseDown event handler, triggering off of the state of certain (mutually exclusive) buttons. Would it be sufficient to simply copy this event handler code into my form that contains the TChart (I guess it would go into the TChart's OnMouseDown handler)? Or is there another method?

-David

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Jul 27, 2004 3:49 pm

Hi David,
my form that contains the TChart (I guess it would go into the TChart's OnMouseDown handler)? Or is there another method?
Yes, you should be able to sue the same code in the OnMouseDown event of TChart.
Or you can have created some functionalities like "Rotate", using the Tool and then Acitvate or not in some cases.

Post Reply