VB用mschart画折线图,怎样做到变换坐标?
我想变换坐标,比如说新增加一个缩短按钮,点击按钮,横坐标就会变短。
这是我的代码:
请大家帮忙
Option Explicit
Private Sub cmd_close_Click()
Unload Me
End Sub
Private Sub cmd_pic_Click()
Dim s As String, i As Long, ss() As String
Dim cn As New adodb.Connection
Dim rs As New adodb.Recordset
cn.CursorLocation = adUseClient
cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=sample;Data Source=."
rs.Open "select number,sdatetime,data from udata", cn, adOpenStatic, adLockOptimistic
If rs.RecordCount = 0 Then Exit Sub
ReDim ss(rs.RecordCount)
With MSChart1
.RowCount = rs.RecordCount
.ColumnCount = 1
.chartType = VtChChartType2dLine
For i = 1 To rs.RecordCount
.Row = i
.Data = rs.Fields("data")
.RowLabel = rs.Fields("sdatetime")
rs.MoveNext
Next i
End With
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=sample;Data Source=."
End Sub
Private Sub Form_Resize()
MSChart1.Width = Me.Width - 1000
MSChart1.Left = (Me.Width - MSChart1.Width) / 2
End Sub
[解决办法]
人家自己在玩,我又何必凑热闹呢?
[解决办法]
还是内定了,内定了就说一下,别让大家瞎忙活
[解决办法]