求一个VB编写的 将数据库里的数据用简单曲线显示的小程序
求一个VB编写的将数据库里的数据用简单曲线显示的小程序即可以将数据库里的表格中数据(一列)用简单折线或者曲线表示下。。谢谢了...
求一个VB编写的 将数据库里的数据用简单曲线显示的小程序
即可以将数据库里的表格中数据(一列)用简单折线或者曲线表示下。。谢谢了 展开
即可以将数据库里的表格中数据(一列)用简单折线或者曲线表示下。。谢谢了 展开
3个回答
展开全部
Dim X(1 To 11) As Long: Dim Y(1 To 11) As Long
Private Sub Command1_Click()
Dim X1 As Long: Dim Y1 As Long
Dim X2 As Long: Dim Y2 As Long
X1 = 0
Y1 = 2000
For i = 1 To 11
X2 = (3000 / 150) * X(i)
Y2 = 2000 - (2000 / 100) * Y(i)
Picture1.Line (X1, Y1)-(X2, Y2), vbRed
X1 = X2: Y1 = Y2
Next
End Sub
Private Sub Form_Load()
Picture1.Width = 3000
Picture1.Height = 2000
For i = 1 To 10
X(i) = CInt(150 * Rnd)
Y(i) = CInt(100 * Rnd)
Debug.Print "x=" & X(i) & " ;" & "y=" & Y(i)
Next
Dim minX As Long: Dim minY As Long
For i = 1 To 9
For j = i + 1 To 10
If X(i) > X(j) Then
minX = X(i): X(i) = X(j): X(j) = minX
End If
Private Sub Command1_Click()
Dim X1 As Long: Dim Y1 As Long
Dim X2 As Long: Dim Y2 As Long
X1 = 0
Y1 = 2000
For i = 1 To 11
X2 = (3000 / 150) * X(i)
Y2 = 2000 - (2000 / 100) * Y(i)
Picture1.Line (X1, Y1)-(X2, Y2), vbRed
X1 = X2: Y1 = Y2
Next
End Sub
Private Sub Form_Load()
Picture1.Width = 3000
Picture1.Height = 2000
For i = 1 To 10
X(i) = CInt(150 * Rnd)
Y(i) = CInt(100 * Rnd)
Debug.Print "x=" & X(i) & " ;" & "y=" & Y(i)
Next
Dim minX As Long: Dim minY As Long
For i = 1 To 9
For j = i + 1 To 10
If X(i) > X(j) Then
minX = X(i): X(i) = X(j): X(j) = minX
End If
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我没用数据库,简单的给你显示了一下
添加部件 Microsoft Chart Control 6.0 (OLEDB)
在窗体上画控件 MSChart1,加入如下代码
Private Sub Form_Load()
'纵轴是根据数据变化而变化的
With MSChart1
.chartType = VtChChartType2dLine '折线图
.RowCount = 10 '横轴
.ColumnCount = 1 '线条数
.Column = 1 '线条ID
For i = 1 To 10
.Row = i '横轴坐标
.Data = i Mod 3 '线条数据
Next
End With
End Sub
添加部件 Microsoft Chart Control 6.0 (OLEDB)
在窗体上画控件 MSChart1,加入如下代码
Private Sub Form_Load()
'纵轴是根据数据变化而变化的
With MSChart1
.chartType = VtChChartType2dLine '折线图
.RowCount = 10 '横轴
.ColumnCount = 1 '线条数
.Column = 1 '线条ID
For i = 1 To 10
.Row = i '横轴坐标
.Data = i Mod 3 '线条数据
Next
End With
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
用Chart控件
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询