我是采用把数据在msflexgrid中显示计算出的数据,然后把表格中对应的列的数据读取到machart中,然后点击绘制的曲线点,该点的值(对应的x,y)在text控件显示的方法:楼主再自己调试下吧
'''Mschart2---运动轨迹的点击显示
Private Sub MSChart2_Click()
Dim i As Integer
Dim xx, j, Max, Min As Integer
Min = 1
Max = Val(VScroll1.Value)
ReDim arrdatac3(Max, 8)
With MSChart2
For i = 1 To Max
For j = 1 To 7
xx = Text6.Text
.Column = 1
Select Case j
Case 1
.RowLabel = MSHFlexGrid1.TextMatrix(xx, j) '''点击显示的指定曲线上的
Text4.Text = "步进变量nx:" & .RowLabel
Case 2
.RowLabel = MSHFlexGrid1.TextMatrix(xx, j) '''点击显示的指定曲线上的
Text5.Text = "角度变量αi:" & .RowLabel
Case 6
.RowLabel = MSHFlexGrid1.TextMatrix(xx, j) '''点击显示的指定曲线上的
Text7.Text = "齿尖切向阻力Fdt:" & .RowLabel
Case 7
.RowLabel = MSHFlexGrid1.TextMatrix(xx, j) '''点击显示的指定曲线上的
Text8.Text = "齿尖法向阻力Fdn:" & .RowLabel
End Select
.AllowSelections = True
.DragMode = 0
.Enabled = True
Next j
Next i
End With
'''''mschart上曲线上的数据全部显示
'''''For i = 1 To MSChart1.ColumnCount
'''' MSChart1.Plot.SeriesCollection(i).DataPoints(-1).DataPointLabel.LocationType = 0 ''&& 为1时显示数值,0为不显示
'''Next i
End Sub