此次的 表开发工具TeeChart Pro .NET使用教程将为大家带来如何制作3D图表。
图表显示模式
二维图表
[C#]tChart1.Aspect.View3D = false;[VB.Net]TChart1.Aspect.View3D = False
3D 正交图表
使用 3D 正交图表时,您需要在自定义绘制到 Canvas 时考虑 Width3D 和 Height3D 3D 偏移。 如果您希望绘制的项目与图表后墙齐平,您应该添加偏移量。 请参阅以下内容:
[C#]private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) { Point p1 = new Point(tChart1.Axes.Left.Position, tChart1.Axes.Top.Position); Point p2 = new Point(tChart1.Axes.Right.Position, tChart1.Axes.Bottom.Position); g.MoveTo(p1); g.LineTo(p2, 0);}[VB.Net]Private Sub TChart1_AfterDraw(ByVal sender As Object, ByVal g As Steema.TeeChart.Drawing.Graphics3D) Handles TChart1.AfterDraw Dim P1 As New Point(TChart1.Axes.Left.Position, TChart1.Axes.Top.Position) Dim P2 As New Point(TChart1.Axes.Right.Position, TChart1.Axes.Bottom.Position) g.MoveTo(P1) g.LineTo(P2, 0)End Sub This example draws a diagonal line across the Chart flush to the Back of the Chart[C#]private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) { int width3D = tChart1.Aspect.Width3D; Point p1 = new Point(tChart1.Axes.Left.Position, tChart1.Axes.Top.Position); Point p2 = new Point(tChart1.Axes.Right.Position, tChart1.Axes.Bottom.Position); g.MoveTo(p1, width3D); g.LineTo(p2, width3D);}[VB.Net]Private Sub TChart1_AfterDraw(ByVal sender As Object, ByVal g As Steema.TeeChart.Drawing.Graphics3D) Handles TChart1.AfterDraw Dim Width3D As Integer = TChart1.Aspect.Width3D Dim P1 As New Point(TChart1.Axes.Left.Position, TChart1.Axes.Top.Position) Dim P2 As New Point(TChart1.Axes.Right.Position, TChart1.Axes.Bottom.Position) g.MoveTo(P1, Width3D) g.LineTo(P2, Width3D)End Sub
在运行时处理 3D 图表的显示属性时使用 Aspect 界面(*注意。并非所有选项都可用于正交图表)。
3D“本机”窗口图表
原生 Windows 模式 3D 提供图表旋转和 90° 仰角。 您可以放大和缩小整个图表(图表内的缩放也可用,请参阅缩放/滚动教程)。
[C#]tChart1.Aspect.Orthogonal = false;[VB.Net]TChart1.Aspect.Orthogonal = False
如果您想了解TeeChart for .NET正版价格,欢迎咨询在线客服

标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!