IAspect.Elevation
IAspect
property Elevation: Integer;
Type Library
TeeChartx
Description
Elevation is supported when TChart is in Native 3D or OpenGL Canvas mode. Elevation is not supported for 2D Charts or for 3D orthogonal Charts.
When in Native Windows 3D mode the Chart supports elevation through 270º to 360º. If the OpenGL canvas is enabled (Aspect.OpenGL.Active property = True) then the Chart may be rotated/elevated through a full 360º.
See the Rotation, Zoom, HorizOffset and VertOffset properties for more possibilities for Chart animation. The TeeCommander component offers a runtime Control bar to enable movement by mouse dragging on the Chart.
Example [Visual Basic]:
With TChart1.Aspect
.Orthogonal = False
.Chart3DPercent = 60
.Elevation = 350
End With
3D Rotation Example
The following example in VBScript for Internet Explorer will generate a webpage with animated Chart rotation, Elevation and Zoom. The Chart uses Perspective and animation is activated by TeeChart's its own timer events.
<SCRIPT LANGUAGE="VBScript">
<!--
Dim DeltaRot
Dim DeltaElev
Dim DeltaZoom
DeltaRot=2
DeltaElev=2
DeltaZoom=2
Sub TChart1_OnTimer()
if TChart1.SeriesCount > 0 then
TChart1.Aspect.Rotation = TChart1.Aspect.Rotation + DeltaRot
If (TChart1.Aspect.Rotation <= 275) Or (TChart1.Aspect.Rotation >= 355) Then
DeltaRot = -DeltaRot
End If
TChart1.Aspect.Elevation = TChart1.Aspect.Elevation + DeltaElev
If (TChart1.Aspect.Elevation <= 275) Or (TChart1.Aspect.Elevation >= 355) Then
DeltaElev = -DeltaElev
End If
TChart1.Aspect.Zoom = TChart1.Aspect.Zoom + DeltaZoom
If (TChart1.Aspect.Zoom <= 40) Or (TChart1.Aspect.Zoom >= 280) Then
DeltaZoom = -DeltaZoom
End If
end if
end sub
Sub Animate()
TChart1.TimerInterval=100
TChart1.TimerEnabled=not TChart1.TimerEnabled
End sub
Sub LoadChart()
TChart1.AddSeries(1)
TChart1.AddSeries(0)
TChart1.Series(0).FillSampleValues(10)
TChart1.Series(1).FillSampleValues(10)
TChart1.Series(0).asBar.AutoBarSize=True
TChart1.Series(0).asBar.BarPen.Color=RGB(153,0,0)
TChart1.Aspect.Orthogonal=False
TChart1.Aspect.Chart3DPercent=80
TChart1.Aspect.Perspective=50
TChart1.Panel.Gradient.Visible=true
If TChart1.Canvas.IsScreenHighColor = True then
TChart1.Panel.Gradient.EndColor=RGB(0,0,151)
TChart1.Header.Font.Color = vbYellow
else
TChart1.Header.Font.Color = vbBlack
end if
TChart1.Header.Font.Bold=True
TChart1.Header.Font.Size=10
TChart1.Header.Text(0)="TeeChart 3D example"
cmdChart1.disabled=True
End sub
'To use OpenGL add TChart1.Aspect.OpenGL.Active = True
-->
</SCRIPT>
<html><head><TITLE>TeeChart 3D animation example</TITLE></head>
<BODY bgcolor=#FFFFFF>
<p><input type="button" value="LoadChart" onclick="LoadChart()" name="cmdChart1"> <br>
<input type="button" value="Stop/Start animation !" onclick="Animate()"
name="cmdChart3"> </p>
<OBJECT ID="TChart1" WIDTH=450 HEIGHT=290
CLASSID="CLSID:008BBE7E-C096-11D0-B4E3-00A0C901D681">
codebase="TeeChart.ocx#version=4,0,0,0" TYPE="application/x-oleobject"
</OBJECT>
</BODY>
</html>