以下是部分示例(具体的可以参考MSDN中MSCHART控件的介绍)
Private Sub Form_Activate()
Call GraphShowBasic
Dim MonthValueYL(11, 2)
Dim I As Long
For I = 0 To 11
MonthValueYL(I, 1) = CStr(I + 1) & "月"
MonthValueYL(I, 2) = (I + 1) * 2
Next I
With MS1
.RowCount = 12
.ChartData = MonthValueYL
.Column = 1
.ColumnLabel = "产值(万元)"
.Refresh
End With
End SubPrivate Sub GraphShowBasic()
With MS1.Plot.Backdrop ' 除非将样式属性正确地设置为VtFillStyleBrush
' 否则不会有颜色显示。
.Fill.Style = VtFillStyleBrush
.Fill.Brush.FillColor.Set 100, 255, 200
' 添加边框。
.Frame.Style = VtFrameStyleThickInner
' 将样式设置为显示阴影。
.Shadow.Style = VtShadowStyleDrop
End With
With MS1.Plot
' 将样式设置为实心。
.Wall.Brush.Style = VtBrushStyleSolid
' 将颜色设置为。
.Wall.Brush.FillColor.Set 255, 255, 225
End With
With MS1.Plot '将绘图底色设置为蓝色。
.PlotBase.BaseHeight = 200
.PlotBase.Brush.Style = VtBrushStyleSolid
.PlotBase.Brush.FillColor.Set 0, 0, 255
End With
With MS1.Title.VtFont
.Name = "Algerian"
.Style = VtFontStyleBold
.Effect = VtFontEffectUnderline
.Size = 14
.VtColor.Set 255, 0, 255
End With
End Sub
Private Sub Form_Activate()
Call GraphShowBasic
Dim MonthValueYL(11, 2)
Dim I As Long
For I = 0 To 11
MonthValueYL(I, 1) = CStr(I + 1) & "月"
MonthValueYL(I, 2) = (I + 1) * 2
Next I
With MS1
.RowCount = 12
.ChartData = MonthValueYL
.Column = 1
.ColumnLabel = "产值(万元)"
.Refresh
End With
End SubPrivate Sub GraphShowBasic()
With MS1.Plot.Backdrop ' 除非将样式属性正确地设置为VtFillStyleBrush
' 否则不会有颜色显示。
.Fill.Style = VtFillStyleBrush
.Fill.Brush.FillColor.Set 100, 255, 200
' 添加边框。
.Frame.Style = VtFrameStyleThickInner
' 将样式设置为显示阴影。
.Shadow.Style = VtShadowStyleDrop
End With
With MS1.Plot
' 将样式设置为实心。
.Wall.Brush.Style = VtBrushStyleSolid
' 将颜色设置为。
.Wall.Brush.FillColor.Set 255, 255, 225
End With
With MS1.Plot '将绘图底色设置为蓝色。
.PlotBase.BaseHeight = 200
.PlotBase.Brush.Style = VtBrushStyleSolid
.PlotBase.Brush.FillColor.Set 0, 0, 255
End With
With MS1.Title.VtFont
.Name = "Algerian"
.Style = VtFontStyleBold
.Effect = VtFontEffectUnderline
.Size = 14
.VtColor.Set 255, 0, 255
End With
End Sub
解决方案 »
- 谁能帮我调试一下啊 我的VB调试不了
- UML 和rose是什么关系?
- =======VB循环插入数据速度很慢========
- 请大家帮我看看这段代码??是treeview控件与数据库的操作的问题!!
- 为什么toolbar和imagelist关联起来确还是不会显示图片?有什么属性会限制吗?
- 如何输入某个年份后,获得该年所对应的生肖是什么?
- 编程的困惑!请您告诉我???????????????????????
- VB版的弟兄,请你支持
- 谁有水晶报表6.0的教程啊!!Help...送分啊
- 怎样在main函数中传出参数。我要写一个没有窗口的.exe执行文件,main是sub,怎样传出结果?
- 我把代码贴来了,这60分,连那40分一共100分一起送了
- 如何控制不让windows系统正常关机?
Private Sub Form_Activate()
Call GraphShowBasic
Dim MonthValueYL(11, 2)
Dim I As Long
For I = 0 To 11
MonthValueYL(I, 1) = CStr(I + 1) & "月"
MonthValueYL(I, 2) = (I + 1) * 2
Next I
With MS1
.RowCount = 12
.ChartData = MonthValueYL
.Column = 1
.ColumnLabel = "产值(万元)"
.Refresh
End With
End SubPrivate Sub GraphShowBasic()
With MS1.Plot.Backdrop ' 除非将样式属性正确地设置为VtFillStyleBrush
' 否则不会有颜色显示。
.Fill.Style = VtFillStyleBrush
.Fill.Brush.FillColor.Set 100, 255, 200
' 添加边框。
.Frame.Style = VtFrameStyleThickInner
' 将样式设置为显示阴影。
.Shadow.Style = VtShadowStyleDrop
End With
With MS1.Plot
' 将样式设置为实心。
.Wall.Brush.Style = VtBrushStyleSolid
' 将颜色设置为。
.Wall.Brush.FillColor.Set 255, 255, 225
End With
With MS1.Plot '将绘图底色设置为蓝色。
.PlotBase.BaseHeight = 200
.PlotBase.Brush.Style = VtBrushStyleSolid
.PlotBase.Brush.FillColor.Set 0, 0, 255
End With
With MS1.Title.VtFont
.Name = "Algerian"
.Style = VtFontStyleBold
.Effect = VtFontEffectUnderline
.Size = 14
.VtColor.Set 255, 0, 255
End With
End Sub
Private Sub Form_Activate()
Call GraphShowBasic
Dim MonthValueYL(11, 2)
Dim I As Long
For I = 0 To 11
MonthValueYL(I, 1) = CStr(I + 1) & "月"
MonthValueYL(I, 2) = (I + 1) * 2
Next I
With MS1
.RowCount = 12
.ChartData = MonthValueYL
.Column = 1
.ColumnLabel = "产值(万元)"
.Refresh
End With
End SubPrivate Sub GraphShowBasic()
With MS1.Plot.Backdrop ' 除非将样式属性正确地设置为VtFillStyleBrush
' 否则不会有颜色显示。
.Fill.Style = VtFillStyleBrush
.Fill.Brush.FillColor.Set 100, 255, 200
' 添加边框。
.Frame.Style = VtFrameStyleThickInner
' 将样式设置为显示阴影。
.Shadow.Style = VtShadowStyleDrop
End With
With MS1.Plot
' 将样式设置为实心。
.Wall.Brush.Style = VtBrushStyleSolid
' 将颜色设置为。
.Wall.Brush.FillColor.Set 255, 255, 225
End With
With MS1.Plot '将绘图底色设置为蓝色。
.PlotBase.BaseHeight = 200
.PlotBase.Brush.Style = VtBrushStyleSolid
.PlotBase.Brush.FillColor.Set 0, 0, 255
End With
With MS1.Title.VtFont
.Name = "Algerian"
.Style = VtFontStyleBold
.Effect = VtFontEffectUnderline
.Size = 14
.VtColor.Set 255, 0, 255
End With
End Sub