其实,这个兄弟的问题我已经解决了;是给俺送分来着;呵呵
大家分享吧
Private Sub Option2_Click(Index As Integer)
'其他面积图、散点图、阶梯图等等最好用在单独的数据分析中
'多数据对比不要用,如果单独分析资产,你可以自己试一试
'只要改变Pic(....)自定义函数中的内容就可以啦
Option1(0).Value = True
Option1_Click (0)
If CountState = True And Option1(0).Value = True Then '统计完毕了
Select Case Index
Case 0 '二维直线图
Pic (VtChChartType2dBar)
Case 1 '园饼图
Pic (VtChChartType2dPie)
Case 2 '折线图
Pic (VtChChartType2dLine)
End Select
End If
End SubPrivate Sub Pic(Name) '直线图
On Error GoTo Err:
Dim Conn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim Rst1 As New ADODB.Recordset
Dim N As Long
Dim M As LongWith MSChart1
.ColumnCount = 1 '纵向数据数
.RowCount = 5 '横向数据数,四 种:年份
.chartType = Name '以上三条语句是建立四行两列Name类的图
'可以做什么样子的图,可以参考Msdn:ChartType常数
For N = 1 To 1
For M = 1 To 5
.Row = M '设置活动列
Select Case M
Case 1
.RowLabel = "0-59分"
Case 2
.RowLabel = "60-69分"
Case 3
.RowLabel = "70-79分"
Case 4
.RowLabel = "80-89分"
Case 5
.RowLabel = "90-100分"
End Select
.Data = ReturnValue(M - 1)
Next M
Next N
.ShowLegend = True '显示图例:
End With
Exit Sub
Err:
MsgBox "出现错误:" & Err.Description
End Sub
大家分享吧
Private Sub Option2_Click(Index As Integer)
'其他面积图、散点图、阶梯图等等最好用在单独的数据分析中
'多数据对比不要用,如果单独分析资产,你可以自己试一试
'只要改变Pic(....)自定义函数中的内容就可以啦
Option1(0).Value = True
Option1_Click (0)
If CountState = True And Option1(0).Value = True Then '统计完毕了
Select Case Index
Case 0 '二维直线图
Pic (VtChChartType2dBar)
Case 1 '园饼图
Pic (VtChChartType2dPie)
Case 2 '折线图
Pic (VtChChartType2dLine)
End Select
End If
End SubPrivate Sub Pic(Name) '直线图
On Error GoTo Err:
Dim Conn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim Rst1 As New ADODB.Recordset
Dim N As Long
Dim M As LongWith MSChart1
.ColumnCount = 1 '纵向数据数
.RowCount = 5 '横向数据数,四 种:年份
.chartType = Name '以上三条语句是建立四行两列Name类的图
'可以做什么样子的图,可以参考Msdn:ChartType常数
For N = 1 To 1
For M = 1 To 5
.Row = M '设置活动列
Select Case M
Case 1
.RowLabel = "0-59分"
Case 2
.RowLabel = "60-69分"
Case 3
.RowLabel = "70-79分"
Case 4
.RowLabel = "80-89分"
Case 5
.RowLabel = "90-100分"
End Select
.Data = ReturnValue(M - 1)
Next M
Next N
.ShowLegend = True '显示图例:
End With
Exit Sub
Err:
MsgBox "出现错误:" & Err.Description
End Sub
www.myvc.net
编程技术论坛欢迎你的加盟!