参考示列2
http://www.foxtable.com/help/index.html?n=0970.htmDim Chart As WinForm.Chart
Dim Series As WinForm.ChartSeries
Chart= e.Form.Controls("Chart1")
Chart.SeriesList.Clear()
Series = Chart.SeriesList.Add()
Dim n As List(of String) = DataTables("配种产仔分析_Table1").GetValues("年")
Dim b As List(of String) = DataTables("配种产仔分析_Table1").GetValues("编号")
MessageBox.Show(1)
Series.Length = n.Count
MessageBox.Show(2)
For bi As Integer = 0 To b.Count - 1
For ni As Integer = 0 To n.Count - 1
MessageBox.Show(3)
Dim dr As DataRow = DataTables("配种产仔分析_Table1").find("[编号] = '" & b(bi) & "' and [年]= " & val(n(ni)) )
MessageBox.Show(4)
If dr IsNot Nothing Then
MessageBox.Show(5)
Series.X(ni) = ni
MessageBox.Show(6)
Series.Y(ni) = dr("配种分娩率")
MessageBox.Show(7)
End If
Next
For r As Integer = 0 To n.Count - 1
Chart.AxisX.SetValueLabel(r, n(r)) '指定字符表示
Next
Next