'试试这个例子,也许会有帮助Private Sub Form_Load() Dim theta_min As Single Dim theta_max As Single Dim dtheta As Single Dim theta As Single Dim r As Single Dim values() As Single Dim i As Integer Dim num_theta As Integer theta_min = 0 theta_max = 3.14159265 num_theta = 100 dtheta = theta_max / (num_theta - 1) ReDim values(1 To num_theta, 1 To 2) ' Compute the data values. theta = theta_min For i = 1 To num_theta r = Cos(3 * theta) values(i, 1) = r * Sin(theta) * 100 values(i, 2) = r * Cos(theta) * 100 theta = theta + dtheta Next i ' Send the data to the chart. Chart1.chartType = VtChChartType2dXY Chart1.RowCount = 2 Chart1.ColumnCount = num_theta Chart1.ChartData = values End Sub------------- www.vicmiao.com 努力就有美好时光!
Dim theta_min As Single
Dim theta_max As Single
Dim dtheta As Single
Dim theta As Single
Dim r As Single
Dim values() As Single
Dim i As Integer
Dim num_theta As Integer theta_min = 0
theta_max = 3.14159265
num_theta = 100
dtheta = theta_max / (num_theta - 1)
ReDim values(1 To num_theta, 1 To 2) ' Compute the data values.
theta = theta_min
For i = 1 To num_theta
r = Cos(3 * theta)
values(i, 1) = r * Sin(theta) * 100
values(i, 2) = r * Cos(theta) * 100
theta = theta + dtheta
Next i ' Send the data to the chart.
Chart1.chartType = VtChChartType2dXY
Chart1.RowCount = 2
Chart1.ColumnCount = num_theta
Chart1.ChartData = values
End Sub-------------
www.vicmiao.com
努力就有美好时光!
触发 call mschart1.dategrid.setdate(,,,,)
还有想让曲线上每个点添加上它对应的数据怎么弄?我显示的是折线。另外产生的曲线还有拌动的效果,哪位大侠解决下??