使用ProEssentials可以创建3D柱状图,柱状图的形式包括线框、实体和阴影。

类似于Graph control,3D柱状图只需要YData。

Subsets定义沿z轴有多少行,Points定义了沿着x轴有多少列。

SubsetLabels和PointLabels用于行和列的标签。 SubsetColors是用来控制子集柱状条的颜色。

一旦用户提供数据,ProEssentials将构造一个3D柱状图。下面的示例代码显示了如何构造一个简单的3D

柱状图。

Dim s As Integer
Dim p As Integer Pe3do1.PEactions =
Pe3do1.PolyMode = PEPM_3DBAR Pe3do1.PrepareImages = True
Pe3do1.Subsets =
Pe3do1.Points = For s = To
For p = To
Pe3do1.YData(s, p) = (+*Cos(p*.))*(+*Sin(s*.))
Next p
Pe3do1.SubsetColors(s) = RGB(+s*, +s*, +s*)
Next s Pe3do1.SubsetLabels() = "Hello"
Pe3do1.SubsetLabels() = "World" Pe3do1.PointLabels() = "Texas"
Pe3do1.PointLabels() = "Washington" Pe3do1.DegreeOfRotation =
Pe3do1.ViewingHeight =
Pe3do1.FontSize = PEFS_SMALL Pe3do1.PlottingMethod = Pe3do1.MainTitle = "3D Bar Chart"
Pe3do1.SubTitle = "" Pe3do1.XAxisLabel = "Points"
Pe3do1.ZAxisLabel = "Subsets"
Pe3do1.YAxisLabel = "Data value"

生成图片如下所示:

工控图表控件ProEssentials创建3D柱状图示例代码-LMLPHP

》》》ProEssentials下载地址

05-02 18:27