HELP!!!HELP!! 我想从数据库里把数据查出来,然后根据查出来的数据生成饼图写进幻灯片! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 应该可以,chart有转为PIC的方法,然后调用PPT对像,应该没有问题吧! 我的问题是把从数据库里选出来的数据做成饼图,写进幻灯片!flxa给个例子看看! Private Sub Command1_Click() If MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2) <> "" And IsNull(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2)) = False Then '该表格有数据 With MSChart1 .ChartType = VtChChartType2dPie .ColumnCount = 2 .RowCount = 1 Dim XXX As Double XXX = Val(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2)) .TitleText = "饼图示例 完成百分比" .Column = 1 .Row = 1 .Data = XXX .ColumnLabel = "完成百分比" & str(XXX) & "%" .Column = 2 .Row = 1 .Data = 100 - XXX .ColumnLabel = "剩余百分比" & str(100 - XXX) & "%" End With ' With MSChart1' .ChartType = VtChChartType2dPie' .ColumnCount = 2' .RowCount = 1' Dim XXX As Double' XXX = Val(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2))' .TitleText = "饼图示例 完成百分比"' .Column = 1' .Row = 1' .Data = XXX' .ColumnLabel = "完成百分比" & Str(XXX) & "%"' .Column = 2' .Row = 1' .Data = 100 - XXX' .ColumnLabel = "剩余百分比" & Str(100 - XXX) & "%"' End With End IfEnd SubPrivate Sub Command2_Click() If MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2) <> "" And IsNull(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2)) = False Then '该表格有数据 With MSChart1 .ChartType = VtChChartType2dBar .ColumnCount = 2 .RowCount = MSHFlexGrid1.Rows - 1 .RowCount = 1 .TitleText = "直方图示例 本旬出口数量与去年同期对比值" Dim XXX, XXXX As Double For I = 1 To MSHFlexGrid1.Rows - 1 XXX = Val(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2)) XXXX = Val(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2)) .Column = 1 .Row = 1 .Data = XXX .Column = 2 .Row = 1 .Data = XXXX .RowLabel = MSHFlexGrid1.TextMatrix(I, 1) .RowLabel = "" Next I .Column = 1 .ColumnLabel = "本旬出口数量" .Column = 2 .ColumnLabel = "去年同期对比百分数" End With End IfEnd Sub 关于调用dll的声明写法 vb6 Put 内存溢出 发送变量的问题 使用VB的Image或者Picture Box的问题 谁有像VB界面一样的窗体原代码 为什么一个普通的form1不能显示出所有的平面? 什么画图 b Help me:谁有微软教材的试验数据库StateUBookstore Database vb读取excel出现问题,请大神解答 菜鸟求援:请问如何一次同时删除Treeview中的多个选项 谁有无限制的activethread控件,通知一下, 很急!
flxa给个例子看看!
If MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2) <> "" And IsNull(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2)) = False Then '该表格有数据
With MSChart1
.ChartType = VtChChartType2dPie
.ColumnCount = 2
.RowCount = 1
Dim XXX As Double
XXX = Val(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2))
.TitleText = "饼图示例 完成百分比"
.Column = 1
.Row = 1
.Data = XXX
.ColumnLabel = "完成百分比" & str(XXX) & "%"
.Column = 2
.Row = 1
.Data = 100 - XXX
.ColumnLabel = "剩余百分比" & str(100 - XXX) & "%"
End With
' With MSChart1
' .ChartType = VtChChartType2dPie
' .ColumnCount = 2
' .RowCount = 1
' Dim XXX As Double
' XXX = Val(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2))
' .TitleText = "饼图示例 完成百分比"
' .Column = 1
' .Row = 1
' .Data = XXX
' .ColumnLabel = "完成百分比" & Str(XXX) & "%"
' .Column = 2
' .Row = 1
' .Data = 100 - XXX
' .ColumnLabel = "剩余百分比" & Str(100 - XXX) & "%"
' End With
End IfEnd SubPrivate Sub Command2_Click()
If MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2) <> "" And IsNull(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2)) = False Then '该表格有数据
With MSChart1
.ChartType = VtChChartType2dBar
.ColumnCount = 2
.RowCount = MSHFlexGrid1.Rows - 1
.RowCount = 1
.TitleText = "直方图示例 本旬出口数量与去年同期对比值"
Dim XXX, XXXX As Double
For I = 1 To MSHFlexGrid1.Rows - 1
XXX = Val(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2))
XXXX = Val(MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2))
.Column = 1
.Row = 1
.Data = XXX
.Column = 2
.Row = 1
.Data = XXXX
.RowLabel = MSHFlexGrid1.TextMatrix(I, 1)
.RowLabel = ""
Next I
.Column = 1
.ColumnLabel = "本旬出口数量"
.Column = 2
.ColumnLabel = "去年同期对比百分数"
End With
End If
End Sub