Rotate
Overview | Properties | Methods
Call this method to rotate a chart.
Syntax
long = PieChartObject.Rotate(Angle As Double, Axis As Long)
The Rotate method syntax has the following parts:
Part |
Description |
Angle |
This is the angle at which the rotation should be set for the axis passed in. The angle is specified in degrees, and is relative to the current position (e.g. the value specified in a previous call to Rotate or one found in the template). |
Axis |
The axis to have the chart rotated around. This value should be zero (0) for the X-axis, one (1) for the Y-axis, and two (2) for the Z-axis. |
long |
Returns a long indicating the success or failure of the operation. Zero (0) is returned if successful, otherwise a non-zero value is returned. |
Returns
A long which indicates the success/failure of the operation. Zero (0) is returned if successful, otherwise a non-zero value is returned. If an error occurs use this return value as the argument for GetErrorText in order to retrieve a relevant text error message.
Remarks
Make sure you only call this method after adding all data to the chart object.
In order to rotate a chart you must let the chart instance know what the rotational angles were after the last rotation operation (defaults are used when the first rotation occurs) before calling the Rotate method. This means that you must preserve state information (session-level variables, hidden inputboxes, etc.) between Chart object creation/deletion.
To set the initial rotation angles use your preserved state information and set the AngleX, AngleY and AngleZ properties. Once you have set the previous rotation angles you can call the Rotate method to rotate the chart. Once this is done MAKE SURE that you record the new X, Y and Z angles for the chart (to be used if the chart is rotated again). To save the chart's new position record (e.g. session variables) the AngleX, AngleY and AngleZ properties.
NOTE: if you repeatedly call this method (to rotate around all three axis) and you then call SendJPEG you must remember the order of rotation for the different axis. In otherwords, if you rotate around the X, Y, and Z-axis in that order then the next time you rotate the chart you must rotate around the X, Y, and Z-axis using the same order.
Note that rotation occurs in screen coordinates, not chart coordinates (e.g. the z-axis is always at right angles to the screen).
Refer to the Rotation Tutorial for sample source code demonstrating rotation.
See Also: AngleX | AngleY | AngleZ | Tutorial: Rotation